Unexplained downloading I was just watching as my bandwidth monitor spiked downloading a file. I checked my current netstat and I didn't recognize one of the IPs so I started capturing the data with Wireshark.

The situation:

None of my services explain the connection
The suspicious IP shows up as malicious Google Search and malc0de database
I have no idea where the data which was downloading went.
Wireshark shows it as a Bronze 0x20 and src port 80 to dest port 36935

My questions:

Where could the data have gone? It was downloading at 2.5MBps for more than a minute!
How can I get more specific information from my Wireshark capture?
What precautions should I take? Just block that IP? Anything else? Like call the Abuse number for that IP from the WhoIs info?

EDIT... More Info: It appears to be a CacheFly shared server hosted on their CacheNetworks.

From the wireshark perspective, one approach might be to look through the capture for ascii strings (using Follow TCP stream) and then search your hard drive for the same string.  If you can find something suitably unique, that might lead you to the downloaded data.

The pair of ports you descibe sounds like a standard web site download (the high port just being randomly assigned to receive the data)

Do you have any automated updating facilities turned on (OS/browser etc)?  One potential source of a largish unknown download would be software updating itself.

As you're running externally facing services from the box there is the chance that you've been compromised and that download was someone putting tools onto your system.  If that's the case you should do a thorough search of the server (some good information here)


Security Alert - Office File Validation - how to decide whether to proceed? Recently, when opening a Microsoft Word document that came from a trusted source, I received the following warning message:

The warning message is titled "Security Alert - Office File Validation".  It says "WARNING: Office File Validation detected a problem while trying to open this file.  Opening this is probably dangerous, and may allow a malicious user to take over your computer.  - Contact the sender and ask them to re-save and re-send the file.  For more security, verify in person or via the phone that they sent the file. Additional actions  - Protect your computer with these: Safer options"

Given that the file came from a trusted source, and that I am confident it came from them, my first inclination is to suspect that this might be a false positive.  How should I decide whether to proceed or not?

(Clicking on "Safer options" does not provide anything useful.)

This is a classic instance of a user being asked to make a security decision, where there are two possible choices: proceed (and get your work done), or cancel (and don't get your work done).  We know how many users will act.  How should one act, in this sort of situation?  What information or criteria should one use to determine whether to proceed or not, when receiving this particular warning message?

If the document comes from a trusted source delivered to you in a secure manner, I would proceed with opening the document. In this scenario, I would consider the chance of it being a false positive to be high enough to warrant proceeding with getting your work done.

However, if the document comes from an untrusted source, or is delivered through a manner that might have the potential for a malicious attacker to modify the file, I would try to work out a solution with the party that provided the document, or just not open the file.

There is also a chance that the source, although trusted, might have been infected with malware that is trying to propogate via the document. Thanks @Polynomial for pointing that out.

A way to check if the document is really malicious would be to execute the document in a sandboxed environment like a virtual machine, which should prevent malware from spreading into your host operating system, if any is present. This is quite troublesome though, and involves highly technical skills such as malware analysis - which the average user does not have.

A lot of it comes down to your risk appetite. How much do you trust the person who provided the document? How much do you trust the delivery mechanism?

In your case - I would proceed, but it is difficult to provide a general answer as different situation requires different actions.


What action can I take to protect against TROJAN Self-Signed Cert I got an email from my network admin suggesting that one of my connected devices might be infected.

Additional information to this case:
Malwaretype: TROJAN Self-Signed Cert Observed in Various Zbot Strains

What action should I take to protect myself, and how can I ensure that none of my private information was stolen?

Assuming your 'connected devices' are computers, you need to verify that you do not have any suspicious certificates in your trusted certificate store.

Of course, every other reaction to a trojan should be performed.

To review your certificate trust store:

In Windows - You can use a tool called RCC from here to scan them automatically, or review them manually like this.
In Linux - See this ServerFault Question. I am not aware of a more readable way of reviewing certificates in Linux, but do try to find one if your computer is a Linux machine.


What are the purposes of these security policies? I work at an IBM lab and there are some security policies that I do not understand the point of. When I ask why we do them my boss simply says it's policy and avoids answering the question.

We must keep empty drawers locked
When we leave work we must lock up writeable media
We must lock any notes up and erase white boards. I don't get this one because someone during the day time could just as easily walk by and see something they are not supposed to.
At meetings if we want to take notes, the notebooks have to be black and have hard covers.
Health information is confidential to the extreme, for example even if a person's boss is sick they cannot give them any ETA on his/her return and can't even answer "is he/she getting better?"

I would really feel better given some reason, even if I don't necessarily agree with them. Any possible explanation is appreciated.

Here are my thoughts on this:

Somebody could hide something--a flashdrive with malicious content, for example--in an unlocked drawer. An employee could find that flashdrive and plug it in to his computer, putting the computer at risk of compromise. Also, it's easier to modify the locks of unlocked drawers than it is to modify the locks of locked drawers. By modifying a lock, a malicious individual could make it easier for themself to gain access to the drawer in the future.
If the media is blank, somebody could put malicious contents on it. If the media's filesystem is "empty" but the media has been used in the past, somebody might be able to recover fragments of old data from it.
It wouldn't be difficult for a janitor (or somebody posing as a janitor) on a night shift to take pictures of a white board, potentially stealing secrets. During the day, the white board is more likely to be surrounded by trusted individuals, making it more difficult to covertly take pictures of it or even get a decent look at it.
Black notebooks are less noticeable than white notebooks. Hardcover notebooks are less likely to lose their covers than softcover notebooks. Covers are important for notebook security. They make it just a bit more difficult to quickly and covertly obtain information from a notebook. They also prevent notebooks from flailing open when they are dropped. Hard covers are better preventers of flailing than soft covers. Also, notebooks with soft covers may be more likely to get misplaced than notebooks with hard covers.
Some sorts of health information are extremely valuable to social engineers. It is common for malicious social engineers to plan attack vectors around employees on leave. For example, if a certain employee is on sick leave, a social engineer might pose as a friend of the employee and gain access to the employee's office by telling somebody he has to bring his friend an item from the office.


Bypassing NET::ERR_CERT_DATE_INVALID When I try to access the Openmailbox web site, Google Chrome returns a NET::ERR_CERT_DATE_INVALID error:

  "openmailbox.org normally uses encryption to protect your information.
  When Google Chrome tried to connect to openmailbox.org this time, the
  website sent back unusual and incorrect credentials. This may happen
  when an attacker is trying to pretend to be openmailbox.org, or a
  Wi-Fi sign-in screen has interrupted the connection. Your information
  is still secure because Google Chrome stopped the connection before
  any data was exchanged.

  You cannot visit openmailbox.org right now because the website uses
  HSTS. Network errors and attacks are usually temporary, so this page
  will probably work later."

This has continued for a few days.

Is it safe to set up a program such as Thunderbird to access my Openmailbox account without manually visiting the web site, or would doing so still expose me to the security risk?

The short answer is no.

That error means that there is a problem on Openmailbox's end of things and changing how you connect to it will not resolve the problem on their server. You should contact their support, and let them know their SSL is not validating properly, then wait until they fix it before trying to connect to your inbox again.


What programming language does this code use? Watching this article:

http://www.exploit-db.com/exploits/13474/

I can see this:

/*
 *  NetBSD
 *  execve() of /bin/sh by humble of Rhino9
 */

char shellcode[] =
  "\xeb\x23"
  "\x5e"
  "\x8d\x1e"
  "\x89\x5e\x0b"
  "\x31\xd2"
  "\x89\x56\x07"
  "\x89\x56\x0f"
  "\x89\x56\x14"
  "\x88\x56\x19"
  "\x31\xc0"
  "\xb0\x3b"
  "\x8d\x4e\x0b"
  "\x89\xca"
  "\x52"
  "\x51"
  "\x53"
  "\x50"
  "\xeb\x18"
  "\xe8\xd8\xff\xff\xff"
  "/bin/sh"
  "\x01\x01\x01\x01"
  "\x02\x02\x02\x02"
  "\x03\x03\x03\x03"
  "\x9a\x04\x04\x04\x04\x07\x04";

# milw0rm.com [2004-09-26]

What are the:

char shellcode[] =
  "\xeb\x23"
  "\x5e"
  "\x8d\x1e"
  "\x89\x5e\x0b"
  "\x31\xd2"
  "\x89\x56\x07"

How could I use them? What programming language are there in? Assembly? Perl? How can I run them?

The content of that array, is low level machine code that will execute the shell /bin/sh, if executed on the correct architecture. An attacker may be able to feed it as data to a program which will execute it as code because of a bug.

It's commonly used to exploit buffer overflows.

One of the core principle of software programming is the concept of sub routines. So a programmer can call a function which has it's own set of variables and does some work. After it is completed, the program continues execution right after the call.

This concept, however, does not exist at the hardware layer. The processor just executes the next command, unless it is a jump to somewhere else.

So in order to be able to return from a call, some preparation has to be done at the time the call is made: The return address is saved on a stack, together with parameters for the function. All local variables that are created by the function are stored on the stack as well. At the end of the function, the local variables are deleted from the stack and the saved return address is used as the target of a jump.

In theory this works fine. In practice a bug in the program may allow an attacker to store some data to a local variable that is longer then the capacity of that variable. Since the local variables are stored before the return address in memory, the attacker may overwrite the return address, to point into his own data. The processor will happily execute it, assuming it is valid machine code.

If you are interested in the background have a look at Smashing The Stack For Fun And Profit. It's old and there are some counter measurements in place today, but it gives a very good introduction.


chat logs seen when on my phone (not compay computer) can owners of private internet see chat logs when using my phone but their internet? Is this possible. I work in someone's house who is an IT genius and just wondered if they can read my hangout or anything else as they seem to react to stuff I say on chat to people?!

Hangout uses HTTPS to send and receive messages.

So normal sniffing of data packets of the wire is impossible. Which leaves the possibility of SSL stripping. But this is possible only if you have willingly allowed your employer to do so.

You can check the following.

Open WiFi settings. Tap and hold your office wifi connection. Tap Modify. Check Advanced Options and verify whether the proxy is set to none.
Open Settings > Security. Go to Trusted Credentials. Verify if any certificate is installed in the User tab.

If proxy is set to none and no trusted credentials from user is added, no one can sniff https traffic. [Unless you install some malware on your phone and let them do that]


Return oriented programming without int 0x80 I have a program with a stack based buffer overflow. It is running PIE with ASLR and DEP, however there is a section of executable code that is at a fixed location.

However, this region does not contain an int 0x80; ret gadget. I can control eax, ebx, ecx, and edx. How can I execute arbitrary syscalls to, say, call mprotect and read in shellcode? Every syscall seems to require an int 0x80, and I'm not sure how to bypass this.

There is an int 0x80 gadget in the relevant code, however it is followed by a jmp instruction.

So I'm looking for either a way to make syscalls without 0x80, or a way to make two syscalls at once (to set memory protections, read in, and execute shellcode)

int 0x80 is a really old way to make system calls. I'm not sure if it is even supported anymore. You might want to look for syscall/systenter instruction in the image. Ofcourse this depends on what underlying hardware and OS you are using. If you are using any hardware/hardware vm emulator and software newer than from 1995, you should probably be looking for syscall/sysenter instruction.
Syscall/Sysenter are used(one or the other used depending on if the executable is 32bit or 64 bit) to make system calls. Register configuration for using syscall and int 0x80 should be the same.
You should be able to find syscall/sysenter easily. most applications should have vdso.so mapped into its address space. You can maybe use this knowledge to find syscall ret gadget. Refer
https://man7.org/linux/man-pages/man7/vdso.7.html
You cannot make two syscalls on the same core at the same time.


Does this kind of USB "port knocking" exist? For security reasons in public spaces administrators choose to disable the USB interfaces.

Is there a possibility for having something like port knocking on disabled/sleeping USB interfaces?

Port knocking in this case would be a detection of a specific kind of device (basically from lsusb information) and ideally some kind of special file inside of a USB pen drive.

Ideally, it would also require multiple USB pen drives with multiple password files.

Is this possible and was this ever done?

Would is be a secure method to unlock the USB interfaces for administrators and administrators only?

It's definitely possible to check parameters of a USB device without mounting/allowing  it to be functional. For example, the tool usbguard provides a Linux kernel module that checks parameters of a device against a whitelist before it can be used.

However, I don't think it is sufficient for authentication. Just like network port knocking, it could be intercepted and then duplicated. Depending on the platform and privileges, maybe non-administrator programs could passively record data about plugged in devices, their contents, and the sequence in which they are plugged in. Or, maybe some really small USB sniffers (almost like a keylogger of sorts; not sure if this exists?) are installed over the USB ports that perform similar monitoring. Then, new USB devices could be created to match the criteria (fairly certain you can spoof nearly all attributes, even using something like Raspberry Pi Zero which can pretend to be a mass storage device).

Now, maybe that could be mitigated by rotating keys over the network on a frequent basis, but then you'd have a lot of physical overhead in keeping your USB keys up to date.

That said, I wouldn't want an administrator entering their own credentials into a machine that is compromised in the above ways. Enabling/disabling USB ports could probably be done safely using group policy or the like, although I'm not sure if there is a ready made solution.


What are the benefits of shutting down a modem router when it is not in use? Are there any security benefits of shutting down a modem router when it is not in use?

It is now widely known that devices such as D-Link have been insecure. Assuming that this remained undisclosed, are there any added advantages of shutting down an insecure device when it is not in use?

If a device is known to be secure e.g configuration, firmware and the like, are there any benefits of shutting it down from a security perspective?

Disconnecting internal devices from the internet when no connection is desired has the benefit that these devices are no longer externally accessible and thus attackable. While on the surfacet this seems "more safe", your devices are not really vulnerable unless they are either in direct communication with something or you forwarded some ports.

The risk to regular consumer devices from attacks over the internet is very small these days, assuming no risky behaviour from the user (e.g. downloading "free_M$_offic_[no_virus_100%_gurarantee].exe").

The downside is obviously you can't connect to your devices if you don't turn your modem on. This might now be a downside for you, if this is not a functionality you use.

I'll elaborate a bit on the points brought up in the comments:

  What does it mean for a device to be in direct communication or have ports forwarded?

In a normal home network, your devices are not directly reachable from the internet. Someone externally can connect to your home router (or router/modem/wifi-access point hybrid), but not directly to your home computer.

The router uses something called NAT, which basically means that your home computer can connect to a remote server and that server can reply, but once that communication is done, the remote server can't reach your home computer anymore. That's a gross oversimplification, but it illustrates the concept that others can only reply to you - they can't initiate a connection to your home PC.

In order for them to be able to do that, you need to configure port forwarding, which basically gives everyone a way to talk to your home computer (as long as that is turned on as well).

This means that if your computer does not have any active connections and no port forwarding is configured, it's essentially not reachable from the internet.

  What is the risk to regular consumer devices these days?

This would be a full question in it's own right, but I would wager that the average risk is rather small. A regular desktop PC, for instance, running a modern, up-to-date OS, will probably not have any publicly available exploits.

Even with other hardware you're likely to be safe, even if an attacker could remotely connect to them in some way. This includes smartphones, game consoles, smart watches, etc.

I'm not saying there is no way that these could have an exploit, because history has shown that there are plenty of exploits for modern operating systems. I'm saying the likelihood that an up-to-date product has a publicly available exploit is very low.

  But what if the vendor does not care?

Usually, if a vendor really does not care, the security community likes to make them care. Imagine you buy a router from GreedyTech, who only cares about profit and not about security. Some security researcher sees that router, and knowing GreedyTech's reputation, he buys it to analyze it. A week later, he finds an exploit and - like a responsible security researcher - he contacts GreedyTech. GreedyTech is not interested in spending any money to secure their products, so they kindly tell him to go away.

The security researcher tries again, explaining at what high risk they put their customers. GreedyTech does not budge, and again tells the researcher in no uncertain terms to "go away".

The security researcher then publicizes the vulnerability, hoping that it becomes as publicly known as possible. Why so? The researcher does this in order to:

Make customers of GreedyTech aware to buy a replacement as soon as possible.
Gather attention from the media, hoping that the bad publicity will force GreedyTech to improve their product or suffer from a bad reputation (and thus less money).

So in a sense, even if a product is highly insecure, it'll probably not stay insecure for that long.


JWT with SSL still need HMAC or RSA signature or I am just paranoid? I am trying to implement an authentication/authorization system using JWT for my web application. The clients are provided with a token on the usual JWT format from my server once they present credentials which I check against the database.

The problem that I thought might arise is that from what I know JWT tokens are not encrypted or signed in any way so I might be a victim of MitM where someone is changing the claims in my payload and send a response or just steal data.

I figured out that this could be fixed by signing the JWT token using HMAC or better using RSA private/public key pair but again the RSA public key should have some kind of certificate attached cause the public key could be compromised at some point.

This is when I asked myself: 'Is it really necessary ?'. If I am getting a SSL certificate for all my pages and I communicate my tokens through it should I also sign them at 'application layer' ? Seems to me that I am just getting paranoid thinking that my CA could be compromised and someone could see my JWT tokens while are sent from the server. What are the chances of this happening ? Should I really take the time to develop one extra security layer before SSL where I generate a JWT token secure it with RSA private/public key pair and then send it to the user through an SSL channel ?

"Signing" JWT's is not a defence against Man-In-The-Middle attacks. As you say, using HTTPS so that TLS/SSL employed is.

Adding an HMAC to a JWT prevents the current user of the session from tampering with the claims.

Take this one:

{
  "admin": false
}

A malicious user may be able to escalate their privileges:

{
  "admin": true
}

Ensure that you have a strong private key and a HMAC authenticated token is enough. Ensure that every JWT checks the HMAC authentication.

RSA is only really useful if you need to send a token to another party or server and you wish to solve the key distribution problem.


How do private feeds get transferred between two different portals? I have some doubts about how the RSS private feeds, get transferred between one portal to another.

The whole point is to allow private RSS feeds to be consumed by external clients, and in 99% of cases, they support basic authentication and SSL. The problem is that external clients can't use FORM authentication of the portal to reach the private pages, making existing private RSS feeds all but useless.

Is there anyway this problem can be resolved, or is it already resolved I need to know.This will help me in a project that I started working on,I want a service that will enable two separate bloggers to share their private posts with each other without necessarily requiring a user name.

I think you should use some kind of tokenning system, if a blogger want to share his RSS feed with another blogger he just has to give the token to the other user, or even better generate a unique token for each reader.

Something like :

http://www.website.com/flux.rss?key=549424e1778e55c0dbfb8bd4a2f6877330b9a46b


How does Authy's 2FA work, if it doesn't connect to the server? I thought I knew how two-factor authentication works:

I enter the password.
Server generates a random number (token) and sends it to me via SMS.
I enter this token.
Server checks that the token I entered matches the one generated for my earlier 2FA request.

But today, I discovered Authy, and it looks like I don't know how this program's two-factor authentication (2FA) works.

Authy shows me secret numbers (2FA tokens) without any connection with the server. How can this be?

I suppose these tokens are not random? Maybe it is some kind of a number sequence, where knowing initial seeding parameters makes this a deterministic process? Maybe this sequence is a function of time? Is that how it works?

Is it secure? Can I, for example, determine next 2FA tokens, if I know a N number of previous tokens?

Authy show me secret numbers without any connection with server. How can it do it ?

Authy is using a one-time passcode (OTP) algorithm which come in a number of flavors, the two most popular being HMAC-based OTP (HOTP) and Time-based OTP (TOTP). Authy is using TOTP.

Both algorithms are essentially the same; they require some seed data and a counter to generate the next passcode in the series.  HOTP implementations increment the counter each time the user requests/uses a passcode, TOTP increments the counter after a given time interval.

In Authy's case, when the user submits a passcode to the server, the server looks up the user's seed data, calculates the counter value based on the timestamp of the request and then generates the proper passcode. The server then checks that the generated passcode matches the user-submitted passcode.

  Is it secure ? Can I know next number if I know N previous numbers ?

Yes and no, it depends on whether or not you trust the server's security.

Given N previous tokens an attacker still shouldn't be able to recover the seed data. However, these algorithms require the server to store the seed data for all of the users.  If an attacker is able to compromise the database (through SQL injection, etc.) then they will be able to generate valid passcodes. This is what happened to RSA and their SecurID tokens (http://arstechnica.com/security/2011/06/rsa-finally-comes-clean-securid-is-compromised/)

Some companies like Duo Security (https://www.duosecurity.com/) and Twitter (https://blog.twitter.com/2013/login-verification-on-twitter-for-iphone-and-android) are tackling this issue by implementing challenge-response two-factor authentication with asymmetric key encryption. They only need to store public keys in this case, meaning that if their database is leaked an attacker doesn't have the private keys necessary to generate valid responses.

Disclaimer, I worked at Duo.

Updated based on questions in the comments

  The algorithms (HOTP or TOTP) must be the same on the server and the client application?

The algorithm is identical, just the way the counter value is generated is different. If Google were HOTP and Authy wanted to support Google accounts, their app would have to generate and store the counter value differently from TOTP accounts.

  Does HOTP client require connection with server to get next passcode (because it doesn't know how much requests was made from last time), while TOTP doesn't require it?

No, HOTP doesn't require a connection to work, but HOTP is generally not used because it's easy for the phone and server to fall out of sync.

Say both the server and app start out with a counter value of 0. The server usually has a window, maybe the next 10 passcodes, that it will consider valid. When the user submits a passcode, the server will compare the submitted passcode with the next 10 generated passcodes. If any of the 10 match, the server can update the stored counter value and remain in sync.

The problem though, is that the user may be able to generate too many passcodes in the app without using them.  If the user is able to increment the counter beyond the passcode window size, then the server can no longer verify that the passcodes are valid.

To see in detail how the OTP tokens are generated, see this informative blogpost.


It it a good idea to whitelist inbound email using a Hash on the address? (Similar to BATV, but with DKIM) Problem Statement

I'm looking at ways to ensure that business partners, or emails from trusted senders, never get quarantined; ....in other words prevent "ham being seen as spam".    Ideally this would guarantee delivery even if the sender was marked as a spammer (...see blackhole list).

Since most email is going through cloud / multi-tenant / shared email providers that share the same IP space, it's likely that the reputation of many different businesses are affecting each other for better or worse.  That is, spammers may benefit from being co-located on "good" tenants, and conversely the "good" tenants may be blacklisted if the spammer gets the IP space listed.

Current email whitelisting solutions requires special action by the recipient, and that database to be maintained on a MTA.  But there are many instances where this isn't feasible or the right solution, such as when offline, at a trade show, or wherever a receiver wants to ensure delivery of a sent message without logging into a web portal or updating Outlook junk mail settings.

Proposed Design

If we modify the TO email address, but prepended with a special value, such a hash, (similar to how BATV works), the MTA / SPAM engine could patently ignore the message and accept it as-is.  Here is what a message would look like:

// The sig below will only guarantee delivery
// for a sender of bill@microsoft.com
// to the account user@company.com
trust=xxxxxxxxxxxxxxxx=user@company.com

// The sig below will only guarantee delivery
// for a sender of alex@microsoft.com
// to the account user@company.com
trust=yyyyyyyyyyyyyyyy=user@company.com

The hash (defined as a HMAC) trust would be the first 80 bits from the function:

(SHA256(Key + Lowercase From + Lowercase To))

When the receiving MTA receives the message with the special address, it will be able to validate the HMAC quickly, and avoid any greylisting or other anti-spam techniques that might be applied.

Assume that either each user is given the salt for their own ability to distribute hashes, and a copy of each hash is available to the MTA for verification purposes.

Making it secure/spoof free

Since anyone could conceivably spoof the tuple of "FROM" and "TO" address above, I think it's a good die to combine this feature with anti-spoofing measures such as DKIM or SPF, which is best defined in the DMARC standard

Usage

For in-person, offline whitelisting

This idea is best fit for times when you  meet someone at a trade conference, bar, or and want to make sure you receive messages from that person.  You don't want any Anti Spam solution getting in the way from them receiving your email.  You would enter in their email address into your generator to create the following address trust=yyyyyyyyyyyyyyyy=user@company.com

This two step process of generating the address could be automated in a variety of applications such as Facebook, LinkedIn, or Bump for iPhone.

For online- email whitelisting

In addition to setting the Reply-To: header, The MUA (email client) could insert a special X-header

X-WhitelistReplyAddress = trust=yyyyyyyyyyyyyyyy=user@company.com

Question

Is the "big picture" goal of this idea reasonable?  (offline whitelisting, guaranteed delivery by MTAs, moving the location of the whitelist from the centralised mail server to the actual senders)
Is there any similar, existing proposed RFC that whitelists trusted sender-recipient pairs this for email?
What other techniques exist to whitelist sender-receiver pairs in email?
What cryptographic components are appropriate for this solution?  Is hashing the right way to go?

Many systems support the use of alias with a character such as +. So, makerofthings7+c6201404b8efbe@invalid-email.com would be equivalent to makerofthings7@invalid-email.com for the MDA (ie. they would end up in the same mailbox).

Then, you keep a list of whitelisted tokens (maybe paired with the From header they must use):
makerofthings7+c6201404b8efbe@invalid-email.com
makerofthings7+f20bb519c3c78a@invalid-email.com
makerofthings7+50d45bcae94598@invalid-email.com
makerofthings7+ecdbe0890dd0c2@invalid-email.com

If someone sends you an email to an address in your list, it gets blacklisted. If it's not, it's automatically treated as spam (to avoid token-guessing). Obviously, if a good token gets compromised, you replace it ;)

The whitelist doesn't need to be stored in the MTA, the filtering can be done locally. For offline uses, you can create in advance a bunch of whitelist tokens. Or even made them up on the fly as long as you update the whitelist checked by the filter before it processes that new mail.

This has existed for some time, I don't remember when I first about it. The best part is that it works today, without having to instruct MUAs about a new X-WhitelistReplyAddress header.

One big difference with your recipients-hashing is that in your solution there is a single key from which the tokens are derived, while here they are randomly generated tokens that you need to list (although you could replace the search the token in the list with check that it matches the right token if coming from this guy). But if a hash-based whitelist token gets compromised, you can't remove it without rekeying everybody's tokens, while in the other approach you can easily replace a single token (moreover, if you keep records of the entities you gave your email, you can find who leaked/sold your email address).


Force download files protected with auth headers By several REST clients the credentials are sent with every request through custom HTTP authorization headers to the REST service. Is there a way to force file download in the browser when accessing files stored in the REST service, is protected with this kind of authentication?

Force file download: Content-Disposition: attachment.
Force file download in browser: document.location.href="{downloadURL}".
There is no way to force file download with XHR.
REST requests must be stateless (according to the statelessness constraint of REST), so the session must be maintained by the REST client, and that's why I have to send credentials with every request.

With a recent browser, you can use client-side JavaScript to prompt the user to save an arbitrary blob (including one you just downloaded from the server using XmlHttpRequest 2).  You can even specify a filename.

See: https://github.com/eligrey/FileSaver.js

One caveat is that I believe the data will have to be cached in memory, rather than written to disk incrementally as it is downloaded, as would be done with a normal file download, which may be a problem for a large file.


nmap.online inconsistent results I recently used nmap online to test my firewall security on the WAN port. I purposely did some port forwarding but received inconsistent results. I opened ports 6881 to 6889 on the firewall and did 2 scans. In Scan #1, the range was set from port 1 through 16382. The result came back as all ports filtered. I found the result strange so I did Scan #2 with only ports 6880 through 6890 selected. This time it did show results on that range. Any idea on why the scan results would be different?

Scan #1

Starting Nmap 6.25 ( http://nmap.org ) at 2013-03-21 07:11 Central Europe Standard Time
Nmap scan report for xx-xxx-xxx-236.dsl.teksavvy.com (xx.xxx.xxx.236)
Host is up.
All 16382 scanned ports on xx-xxx-xxx-236.dsl.teksavvy.com (xx.xxx.xxx.236) are filtered
Nmap done: 1 IP address (1 host up) scanned in 1717.66 seconds

Scan #2

Starting Nmap 6.25 ( http://nmap.org ) at 2013-03-21 08:08 Central Europe Standard Time
Nmap scan report for xx-xxx-xxx-236.dsl.teksavvy.com (xx.xxx.xxx.236)
Host is up.
PORT STATE SERVICE
6880/tcp filtered unknown
6881/tcp filtered bittorrent-tracker
6882/tcp filtered unknown
6883/tcp filtered unknown
6884/tcp filtered unknown
6885/tcp filtered unknown
6886/tcp filtered unknown
6887/tcp filtered unknown
6888/tcp filtered muse
6889/tcp filtered unknown
6890/tcp filtered unknown
Nmap done: 1 IP address (1 host up) scanned in 3.31 seconds

The results are consistent. In both cases you're getting that all the scanned ports are filtered. The Nmap setup at domain-tools seems to be configured to not show the state of more than 25 consecutive ports separately.

In the first case you specified 16382 ports and they all turned out to be filtered, so Nmap won't bother printing all 16382 ports, it will just tell you they're all filtered.

In the second case you specified only 10 ports, they all turned out to be filtered, but this time since they're not so many, Nmap printed them all.


Airodump-ng : why are BSSID not associated? Using airodump-ng with my wireless adapter in monitor mode, I am able to get expected scan to run.

I have a few questions :

Why do BSSIDs show as "not associated" (note: not all of them show as such, some just show a usual BSSID)
If I understand correctly, the STATION BSSIDs are access points to which the clients are connected, why are they not showing up with the above AP list? Are they simply not in range?

If I understand correctly, the STATION BSSIDs are access points to which the clients are connected,

You are correct.

  why are they not showing up with the above AP list?

From the airodump-ng documentation describing the "BSSID" field:

 MAC address of the access point. In the Client section, a BSSID of
 “(not associated)” means that the client is not associated with any
 AP. In this unassociated state, it is searching for an AP to connect
 with.

So typically the application has detected the client by hearing it send probe requests trying to find nearby wireless networks.


Is it risky to URL-encode characters in an already URL-encoded string? I'm maintaining a legacy web application which is composed of the application itself, accessible to the public, and the REST services which can be accessed only by the application through the LAN. At one point, the application performs a request to a URI of a service which looks like this:

GET https://internal-service/hello/world/user-input

Here, user-input is based on something the user entered, and which is encoded by the application to prevent the user from injecting slashes and other special characters. The encoding is done by calling an appropriate (and reliable) function from the framework.

However, services are separated from the application by a reverse proxy which have a bunch of weird rules. One of them is that there should be no dots in an URI. To cope with this restriction, I replace all the dots from the encoded string by %2E.

For instance, the input: “a/b.c” would lead the following URI to be called:

GET https://internal-service/hello/world/a%2Fb%2Ec

since the first step would produce “a%2Fb.c” and then the second step would replace the dot.

By doing that, am I jeopardizing the security of the whole system, by making it possible for the user to somehow inject unauthorized characters in the URI?

I'm afraid that there might be a quirk related to the way such string would be decoded to an UTF-8 string, i.e. that a specially crafted Unicode character followed by a dot would be encoded to %??%2E which, in turn, would be decoded not to the same character followed by a dot, but by a completely different single character. Or, for instance, I would imagine it to be decoded to a question mark—a character which has a special meaning in an URI.

Is it possible?

Are there other risks?

Adding a URI encoding for a character in an already URI encoded string, when you know where that URI encoded string will be decoded has a vanishingly small probability of exploitability. It would have to allow a string to bypass a filter located between where the string is encoded and where it's decoded.

There are always risks, of course, but you have to specify a receiving end if you want to identify security risks. The biggest risk is that the receiving end won't know to decode the additional URI encoded parts at all, and it will break the system.

If you have no control over the receiving system or insight into what it's going to do with the string, then you can't identify a security risk. There's always the (negligible but non-zero) chance that you'll trip over something.


Why do browsers expose installed fonts? It's a well known fact (in the privacy-aware community, at least), that a factor quite used for tracking is the list of installed fonts, which browsers seem to expose, and trackers exploit this.

There's lots of questions and answers as to how to avoid this (spoof list of installed fonts, etc), but I'm wondering: why do browsers need to expose installed fonts? What uses cases does it satisfy in the first place?

Browsers don't directly make a listing of the installed fonts available. Instead they provide information about the size a specific object like a textbox has. Since the same text rendered with different fonts causes slightly different object sizes this can be used to infer which font was used to render a specific text and thus check if a specific font was used to render the text (and is thus installed on the system) or not.

For more information see Font Fingerprinting at browserleaks.com or the paper Fingerprinting web users through font metrics.


Is Username/Display Name Login more secure than email login? I recently started playing Star Wars: The Old Republic, which for those of you who don't know, is an MMO. Before playing the game, I would always log in with my email/password combo. However, I got an email from Bioware (the developers) today, that said this:

  Beginning April 2, 2013, you will only be able to log in to the Game or Website using your
  Display Name – Your email address will no longer be accepted from that point forward.

It goes on to say that

  This new change to the log in procedure is being implemented for several reasons. This change increases the security of our game authentication system, which helps continue to keep the game protected from many security threats including account takeovers.

Is forcing me to log in with my username instead of my email actually more secure than logging in with an email? Both use the same password. Why would a company choose to do this, from a security standpoint?

This is because people use the same password when they shouldn't.  If a key logger gets your SWTOR login email and password, they can't send an email to verify suspicious activity since the attacker may have your email account as well.

Using a display name prevents password reuse from resulting in the email address also being compromised as easily.  This makes it easier to recover a stolen account since if they don't have access to your e-mail address, they can't respond to any confirmation e-mails that SWTOR customer support sends to it.


Is there something similar to Firejail for OpenBSD? On Linux, Firejail (https://firejail.wordpress.com/) offers an easy way to sandbox web browsers and other programs.

Is there an easy way to sandbox a web browser on OpenBSD ?

(reserve question: is there a non-easy way ?)

Some developers are working on a sandboxed version of Chromium. I don't know if there is a public diff or not. With pledge and unveil, they can limit the syscalls used and the directories viewed by Chromium.

Firefox only uses pledge, so it has not whitelisted/blacklisted directories.


Why do botnets use IRC but not a web service for communication? IRC seems still the most prominent way for communication within botnets.

Why do attackers choose IRC?

In my (very naive) opinion, to set up a web service is far more easier.

There are at least two types of schemes how to controls botnets:

via C&C;
decentralized scheme;

The following ways of C&C botnet networks exists:

IRC (one or many);
control via web servers;
internet messengers;

Without C&C:

peer to peer networks;
trust rings;

Combined schemes are also possible, thus taking the best of each technology. It is not rare case when botnet developers creates their own protocols to leverage the capabilities of control.

First of all, IRC is used because it allows simple way to deploy communication network. For very small amount of bots it is enough with one IRC server, when server is unable to handle some peak moments of when bots online, several IRC servers can be joined. But, this type of networks is not for serious botnets nowadays. See my comments here: Malware known to use port knocking to evade detection by network scanners?.

By minimal complexity control via web server is similar to IRC. However, it allows more possibilities of control scheme variations. Is easy to deploy, control and to loose too. One of the most popular ways how to control botnet.

Control via internet messengers is not popular, because it is hard to create such network without headache for botmaster. Registration of accounts for one person is not a problem, but when it comes to automation of process, the problems starts.

Peer-to-peer botnets are hard to develop, but they can provide more stable and robust network.

The so called "trust ring" is even more complex scheme, but because of it's way of decentralized scheme it is hard to kill it. This is similar to scheme that is used in Skype.

C&C botnets are easy to create, but also easy to kill - just destroy control center. The last two types of C&C-less botnets are often seen used in serious botnets, because of really serious authors intents to be in big business of bad boys.

By the way, botnets are used not only in malicious purposes.


Threshold for biometric authentication I would like to ask, what are appropriate ways to adjust thresholds for a biometric system when we have only training and testing data of a single user?
I am using Speaker, face and gait recognition but in mobile device scenario. In mobile scenario we know that we have always 1:1 matching case (We can go for 1:n matching but this would make system less usable as it is time taking, and need bigger data sets and we don't need it.). So, in this situation I want to find some way where I can find threshold from the training data. and whenever i get some test data I assume that this data is coming from genuine user and after matching, threshold basically decided if a that person is genuine/impostor.

It depends on how the learning is done by the biometrics system.

If the system is distributed to you with prior knowledge of what a human face is, and if you're only teaching it the faces it should accept, it would be enough to just enrol the authorised users.

If the system is merely a computer vision learning model without any prior knowledge, you'd need to build a dataset of human faces representative of the human population, label the faces of the authorised users as authorised and the others as denied, and train the system.

I've never used the system you're asking about, so if you cannot figure out in which of those two categories it falls, I suggest you contact the customer support of the manufacturer.


Modifying host file versus firewall I am trying to protect a macOS computer. Specifically, I want to prevent the machine from making unwanted connections over the internet.
I am aware of firewalls of course. But I stumbled upon the idea of adding many domain names to /etc/hosts, and redirect them to 0.0.0.0 to prevent connections to them.

Is this method safe? I can see it does not prevent connecting directly to an IP. Would most malware be fooled by such a hosts configuration, or would they likely use directly an IP address, or not honour the /hosts file?

How should I compare using a firewall versus using the /etc/hosts file? I guess the most low level, the harder it is for malware to get around. So which method is lowest level?

If you're trying to protect against mostly-benign software, this should work fine. Some software might make its own DNS calls (bypassing the OS DNS resolver, which checks the hosts file) and some will probably use direct IP addresses, but most by far will just ask the OS to resolve the names.

If you want to restrict potentially-malicious software, this is definitely insufficient. Safely containing malware is tricky, and requires sandboxing far in excess of what you've talked about here. Malware will absolutely use hardcoded IPs and/or make its own DNS queries, but it will also do things like change firewall settings (if running with sufficient privileges), scan and attack local network hosts (which may not even have DNS entries, at least not ones the malware will see or care about), and of course monitor and/or interfere with legitimate traffic from the machine.

However, between the two options, a firewall is definitely "lower level" than the hosts file. An external firewall (which might be on the same physical host, but running in the host OS of a VM or container) will work better than a local one (which might be overridden by sufficiently-privileged software), but changing a hosts file provides no actual restrictions whatsoever; it's merely (taking away) a convenience.


Router being infected by malware If you connect a computer that is infected with malware (the government grade, kernel infecting, extremely persistent, easily spreadable kind) to a router or modem, can the router or modem or its firmware be infected in such a way that, when you connect another computer to it, the infection transfers?

The two computers are never on the LAN at the same time.

You don't need government grade malware to do this and such attacks have actually been carried out for years. Typical SOHO routers are often vulnerable to CSRF and similar attacks and this can be used by the attacker to compromise the router, i.e. changing critical settings like the DNS servers. This compromise can be executed when you visit a web site. It does not even need to be a "bad" site since such an attack can be executed from inside embedded advertisements too (malvertisement).

For an example of such an attack see How millions of DSL modems were hacked in Brazil,... which talks about how attackers compromised millions of routers in Brazil using CSRF attacks. They then changed the DNS settings in the router so that the traffic got diverted to the attacker. With this man  in the middle attack the attacker then could inject advertisements or malware into the traffic to every computer using this router.

These attacks are unfortunately very common today since a large proportion of SOHO routers are insecure. See Website Security – Compromised Website Used To Hack Home Routers for hacking via compromised web sites or Spam Uses Default Passwords to Hack Routers for similar hacks done via spam mails.

As for the enterprise level routers: Once you are in (maybe via a backdoor) you effectively own a large network with often sensitive information inside. By manipulating the routing you can divert the traffic to the attacker and do the same attacks and more as described above. The main difference is that you have far more computers behind the router and these have usually more more interesting information than you will find in home networks. This means the return of investment for the attacker is usually higher when enterprise routers or even routers as ISP's are compromised.


Sharing access-tokens in response header? What's the best way to share my access tokens? Is it okay to share it in the header as plain-text, or do I need to look into e.g. JWT?

Current workflow:

-> POST /api/login -d {**creds}
<- 201 [headers (including X-Access-Token)]
-> GET /api/secrets -H 'X-Access-Token: ""'

The header currently consists of:

X-Access-Token: <scope>::<uuid>::<expires_in>::<state>

If you are doing this for federated identity (single machine/human using multiple services) then use a purpose-built system for that.

Federated identity is hard to build correctly and unlikely to be important enough to your business to be a core competency that you'll justify maintaining properly.

I recommend using SAML 2.0 because it is broadly deployed and supported.  Many implementations (including Shibboleth/OpenSAML) have been extensively pen-tested.

JWT is very similar to SAML, but is still evolving and the inconsistencies in implementations could make it frustrating to deploy successfully.

Both are based on sound cryptographic techniques and deploying them securely depends fundamentally on effective key management.  Using a single private key for signing SAML Assertion or JWT Tokens for an excessive time period, volume of assertions/tokens, or after suspected compromise of a system with plaintext key access compromises the security of all federated services.


Should antivirus be centralized? We have hundreds of workstations, tens of servers, both Windows and Linux, in tens of premises, with centralized logs. And we have an internal rule that says the antivirus shall be centralized. I would like to understand the rationals for it and what does it mean exactly.

Is it to benefit from an alert by enriching all local antivirus instance with new IOC, avoiding propagation in other premises?
Is it to ease the updates?

The biggest benefit is reporting. Without central control, you have no idea if an endpoint is updated, having problems, on an old version of a client, whether there is a high-risk endpoint getting hit, or if there is a certain endpoint with a higher than average number of hits, etc.

If your AV solution allows you to distribute IoCs, then yes, that's a value, but that's not normal.

Endpoints should update themselves, so that's not an issue.


Reducing hash output length I am using output of (keyed) hash function to make sure the input was not modified, I store it along with input.
Now output of SHA-1 is 20 bytes.
Say I want to reduce the output. And have it output 10 bytes - I know I can truncate it (e.g., just take first 10 bytes of 20 bytes).

But my question is: how much can I truncate output so that it is still reasonably secure? (assuming like I said I use this for verification, e.g., make sure string that I hashed didn't change).

Can I reduce it to 8 bytes say? Is it still reasonably secure? (for my needs)

Edit: like I said I want to make sure attacker does not change the string- hash of which i store. In other words I am interested do collision attacks apply in my case? These strings I need to protect are meaningful english sentences. This is how my question is different from so called duplicate- there is no such information.

Ps Existing answer does not fully address this

Answer depends on your security model.

Classically, a cryptographic hash function has three properties:

It resists preimages: given y, it is infeasible to find x such that h(x) = y.
It resists second preimages: given x, it is infeasible to find x' such that x ≠ x' and h(x) = h(x').
It resists collisions: it is infeasible to find x and x' such that x ≠ x' and h(x) = h(x').

For a "perfect" hash function with an output of n bits, the resistance is up to effort, respectively, 2n, 2n and 2n/2 (regardless of how strong the function is, "luck" still works with a small probability, and that gives these average costs for finding a preimage, a second preimage, or a collision).

When you truncate the output of an existing hash function, you are in fact defining a new hash function, and since that hash function has a smaller output, its resistance is correspondingly smaller.

The good question is then: which of these properties are you relying upon ? This depends a lot on the context.

For instance, suppose that the attacker's goal is to alter an existing piece of data, without being detected through a hash function mismatch. This is a second preimage situation: attacker sees a message m and tries to find a modified message m' that hashes to the same value. In that case, truncating to 10 bytes means that you still have resistance 280, a huge number that will deter all but the most determined or irrational attackers. Note, though, that an attacker may have a choice of targets: if the attacker sees 100 messages, and wants to modify one of them (with no preference over which can be modified), then "luck" works 100 times better. Thus you may want some extra security margin and keep, say, 12 or 13 bytes of output.

Now if the attacker can get to inject his own innocent-looking message m, that you validate and hash, and will later on replace it with a distinct message m' with the same hash value, then this is a question of collisions, thus working with resistance 2n/2 for a n-bit output. In that case, truncating the hash function output is a quite bad idea.

The safe course is not to truncate anything. After all, as I write above, truncating the output is equivalent to designing your own hash function, and, in all generality, this is very hard to do properly. SHA-1 has a 160-bit output precisely so that you get "at least 280 security" in all cases. Determining whether collisions apply to your situation or not can be hard.

Also, remember that a hash value does not create integrity; it just concentrates the issue. When you hash a piece of data, you get a hash value, and that hash value will guarantee that the original data is unchanged only insofar as you can be sure, through some other means, that the hash value itself was not altered. If you store the hash value along with the data that is hashed (your "input"), and the attacker is assumed to be able to alter the stored data, then what exactly would prevent him from modifying the hash value as well ? Whenever he wants to put m' instead of m in some database cell, he may also put SHA-1(m') into the neighbouring cell, overwriting the SHA-1(m) that was there, and you will be none the wiser.

If you want to use hash values to protect data integrity, then you must ensure the integrity of the hash values themselves in some other way. Hash functions reduce the problem: instead of protected a 1-gigabyte file, you "just" need to protect a 20-byte hash value. But you still have to do something.

Cryptography can help you further concentrate things by using a MAC instead of a hash function. With a MAC, you have a secret key, and you can use one key for millions of MAC computed over millions of "inputs". There again, you still have to do something, but that something is: keep confidentiality of a single key (of, say, 128 bits) for the whole of the server.


Password-hash proofing SHA-3 I am in a situation where I need to harden a password hash, but not allowed to bring in any extra dependencies, so I am pretty much forced to do the one thing everyone seems to advise against - roll out my own implementation.

The SHA family, being considered fast hash, doesn't seem suitable for password hashing. And there is also the risk of loss of entropy from repeated hashing hashes.

The intent behind "slow hashing" seems to be increasing CPU time and memory requirements, so I conceived the following strategy.

the password is hashed via SHA-3 512
the hash value is fed to a mt19937 PRNG through a seed sequence
a long random sequence is generated to be rehashed
recurse the same for n number of times
the final hash value is derived from hashing all sequences inside out

That seems to introduce a fair configurable extra amount of work and memory requirement.

So my question is whether this is a reasonable strategy, and if so, what sequence lengths and recursion depths should be enough.

Update:

I ended up expanding the implementation a bit, by also incorporating a hashing algorithm at "random" for each step of the process, 12 in total - SHA2, RealSHA3 and Keccak with digest size of 224, 256, 384 and 512, using a clamped double as a selector.

All in all, compared to a single plain SHA3 hash, this implementation is about 100k times slower, and incurs an additional ~20 MB RAM cost over a rather deep and arbitrarily branching recursion to produce the final hash, which is what I can afford while still staying within reasonable limits considering the minimal target platform specs. But possibly just as important, this brings additional computational diversity compared to the naive "rehash n times" approach, using multiple hashing algorithms, PRN generation with fairly large internal state, std::seed_seq is always fed the full hash output and does additional "conditioning" of the values, and last but not least, adding in some double precision floating point operations to glue it all together, hopefully making the whole procedure GPU/ASIC unfriendly.

Hashing now takes about 500 msecs, up from 5000 nsecs, on a 4 Ghz i7 CPU. Given the total of 95 symbols allowed in a password, and assuming perfect scaling up to 8 threads, it would take this PC ~1450 years to try every possible combination for an 6 character password, or ~130 years for an 8 character password using 100k such CPUs, which seems reasonably demanding.

Is this considered "hardened" enough, and if not, how can I improve on it?

There is one solution to this which does not require that you include other dependencies like Argon2. You can implement the algorithm used by OpenPGP, called String-to-Key, or S2K. This algorithm works by feeding the repeating password and salt to a hash function. The password and salt are repeated enough that it takes the hash function a non-negligible amount of time to process it. This is such a simple slow KDF that it can even be done using standard Linux utilities (in this example with SHA-256):

yes "$pass$salt" | head -c 50M | sha256sum

If you are ever able to bring in your own dependencies, I highly recommend listening to Future Security whose excellent answer lists superior alternatives to both S2K and your custom scheme.


Avoiding Dark Web monitoring detection At our company, we offer security services to our clients. One of the things that management has pushed down to us is the need for dark web monitoring.

Because I am in the business meetings as well, management has come to this conclusion because many CEO’s, or the ones we work with, eyes light up when “dark web” is mentioned. My management plans to offer the monitoring of 10 key and/or important individuals in a company.

While we are going through this process, this made me wonder how an attacker might avoid detection. Sure, many of the existing tools are proprietary but having researched them, generally, they seem to be just crawling the Dark web through Tor browsers.

My question (purely for academic reasons): How might you, as an attacker, avoid detection on the dark web given that you have confidential information on 10 key individuals of a company and you are trying to receive some sort of monetary value for it?

I imagine an answer with steps, from the day you gain access to the confidential data to the day you sell it on the dark web.

* This answer would really help me in defining the scope of the service we are going to offer and to be realistic to clients.

**IMHO, I do not believe in the usefulness of dark web monitoring because it gives a false sense of security.

Obtaining Access

To begin a dark web is a network (often encrypted) which overlays the Internet but requires specialised software to access it. The Tor client, supplied within the Tor browser bundle, will connect to the Tor network and direct traffic through a triplet of nodes: entryNode --> relayNode --> exitNode. All three nodes will encrypt data transmitted with their public keys in the order:

(entryNodePublicKey(relayNodePublicKey(exitNodePublicKey(data)))

Unless you have spyware loaded onto the host computers for the "important individuals" you will only see the entryNode IP address and encrypted traffic. Using this IP address you could confirm it belongs to the Tor network, as an induction node or guard node.

Because Tor is implemented for political activists, whistleblowers, oppressed dissidents, etc... it has built-in tools for censorship circumvention, OBFS4 bridges are among a few common methods, but another is using meek bridges. Meek bridges take advantage of AWS and Azure for domain fronting, this will make the Tor entryNode when performing DPI appear as an HTTPS amazon.com or microsoft.com connection; normal traffic. This method is deployed to circumvent the Great Firewall of China.

Equally other methods to conceal the entryNode connection include, but are not limited to:

OpenVPN using AES encryption: most modern VPNs
Proxy: HTTP, HTTPS, and SOCKS
RDP (or any other remote access protocol, preferably encrypted)

The RDP idea will involve connecting to a remote computer and be using that to access the dark web, with or without the protection of VPN(s) or proxy(s).

Mentioning about circumventing censorship has relevance, as Vault 7 disclosures outlined CIA malware would use data centers as botnets and would prefer performing any connections over HTTPS (with modern ciphers) on port 443. This would draw much less attention to connection logs when reviewed by a SysAdmin.

With this information in mind, now we should consider without tremendous detail, the metadata and "noise" the attacker made when obtaining the confidential information. Questions include:

Did they leave logs and metadata concerning the breach?
Did they use someone else's access to access the confidential information, or use a zero day exploit?
Do IP address logs belong to residential IP address(s) or recognised anonymising networks.

We have now built knowledge of when the confidential information was stolen. So, now we can see if the attacker had vulnerabilities within their OpSec that we can use to deanonymise them.

Selling the Information

This would be your second (and last) opportunity to identify the attacker. This also may not be possible, as it involves tracing the payment method, which could also employ money laundering.

This confidential information is now an asset to the attack. Presuming their goal is to profit from the attack, we will sell the information onto a buyer. A dark web marketplace would be a good start. Although, they could have been hired by a wealthy group to perform the attack. So, the information will be sold via either method:

Dark web marketplace
Closed auction (private)

The timing for selling this information would depend on the nature of the breach. Intellectual property with patents would not need a critical sell window, while a database of password hashes should be sold ASAP before the passwords are changed.

Payment would be your opportunity to trace the attacker. Payment could cover several forms:

Dead drop bank account(s)
PayPal
Credit/Debit card(s)
Cryptocurrencies

I cannot elaborate much further here, as money laundering is its own topic, and can be very broad. I can state that, the more judiciaries the IP addresses and payment cover, the more cumbersome and less likely you are to identify the attacker.


Password manager and account recovery I'd like to start using a password manager, but I'm not sure how to handle account recovery.

I'm not a criminal or a secret agent, so if I lose my master password (or my second authentication factor, like a Yubikey thumbdrive, or my own thumb), I don't want my data to be unrecoverable (and by "my data" , I mean "my access right to all my accounts for which I used my password manager to store potentially automatically generated and forgettable passwords": I can afford to lose access to my password manager, if I can reset it, and regain access to all my accounts separately with each of their account recovery options).

Let's assume I don't use the password manager's vault recovery, because they all seam unsafe or unpractical, when they are available.

The only way to be able to recover any account in any situation (phone, computer and password-list-on-a-piece-of-paper lost or taken by someone else, for example) is by using account recovery from an email address, since it only requires an internet access and a password, but it just moves the problem elsewhere.

For example, I could use an unique recovery email address for all accounts from a security-oriented provider like ProtonMail, and use it only for account recovery to make it less visible to potential attackers.

But it's still another password to remember (with the master password) and another entry point, and if I use the password manager to store this new password but lose the master password, the recovery address becomes useless.

The only solution I can think about is by using a trusted person (like my wife) to store on their password manager my recovery address password and to never change it (unless their master password is compromised for example), and I could do the same for theirs. That way, it's unlikely that we both lose access to our respective password managers.

So my question is: Which strategy is the best concerning password manager and account recovery?

Are password managers vault recovery more secure than my propositions? Are there better alternatives?

P.S. : When I say "password manager's vault recovery", I mean "password manager's means to recover my vault or my master password", and when I say "account recovery", I mean "account provider's means to recover my account or my password which I stored in my password manager", for example, Facebook specific account recovery means.

I think that you are confused about how password managers work. You mention using an email recovery option, that's just not possible with any serious password manager. A password manager service doesn't know your master password, so they can't give it back to you in an email. It's just impossible.

Some password managers support emergency access (eg: LastPass's emergency access) that give other users delayed access to your vault. This allows you to give someone access to your vault after you haven't logged in for a few days. Note that this may not include recovering the master password (LastPass doesn't support password recovery), but it does give access to the vault contents. Using such a recovery method, you could store your master password in your vault and rely on the trusted person and delayed emergency access to recover the master password.

The emergency recovery strategy is similar to using another person's vault to store your password, but it adds a delay. This has pros and cons. If you need the password quickly, the delay is a hassle. But if the other person's password vault is somehow compromised, the delay gives you time to revoke emergency access before yours is compromised too.

If you do want to use paper as a backup of your master password, store it somewhere secure - like a safe deposit box. While that doesn't provide instant access, it reduces the chance of the paper being viewed by an attacker to near zero.

The easiest solution is, of course, to just not forget your master password. Personally, I write my master password down when I change it, carry it with me for a few days, then securely dispose of it (consider fire) once I have it memorized. I've never forgotten it (though I do have emergency recovery set up).


Terminology: What kind of security applies to industrial control systems, fire alarm systems, etc.? I am wondering what you would call the kind of security that applies to systems such as industrial control (SCADA) systems, building automation systems, fire alarm systems, etc.

These systems are characterized that they for the most part consist of networked embedded devices, sensors, actuators, and possibly a few PCs as management stations, too. They don't store much if any personal information, and many systems also won't store strictly confidential, intellectual property information. On the other hand, unlike purely electronic systems like online shops or banking systems, they either provide life safety-related services (fire alarm systems) or could directly cause life safety threats (e.g. harm humans through an out-of-control industrial process).

The term "information security" applies to secure handling of information (AIC triade: availability, integrity, confidentiality=privacy) but I would argue that information security in the all-encompassing sense is of much greater concern in healthcare, banking systems, etc. where personal information, confidential information, trade secrets, or top-secret government information is involved.

The term "computer security" is from what I can tell generally used for computers and nowadays also for smart phones.

"Network security", from SANS, is the process of taking physical and software preventative measures to protect the underlying networking infrastructure from unauthorized access, misuse, malfunction, modification, destruction, or improper disclosure, thereby creating a secure platform for computers, users and programs to perform perform their permitted critical functions within a secure environment.

"System security" sounds very unspecific and a quick Google check confirms that it is used in many different contexts and meanings.

Security in industrial control (SCADA) systems, building automation systems and fire alarm systems involves aspects of all four security "areas" mentioned above, but is anybody aware of a single "xxx security" term that would intuitively apply to such types of systems?

Thanks a lot, Christoph

Security in industrial control (SCADA) systems, building automation
  systems and fire alarm systems involves aspects of all four security
  "areas" mentioned above, but is anybody aware of a single "xxx
  security" term that would intuitively apply to such types of systems?

It is generally refereed as Industrial Control System (ICS) Security, SCADA Security or Control Systems Security. In fact there are a few certification with the similar title for security professionals expert in ICS or SCADA systems e.g Global Industrial Cyber Security Professional (GICSP), or books with titles like Industrial Network Security or Handbook of SCADA/Control Systems Security cover the the security in these systems.


Kerberos replay attack within allowed range - authenticator won't prevent it? In kerberos protocol the client, after receiving a ticket to the TGS server, sends a request to the TGS and adds an authenticator to the request.

What if an attacker performs a replay attack within the allowed clock skew, so that the difference between the timestamp in the authenticator the attacker copied and the TGS's clock is still allowed. What kind of check will the TGS perform in such a case ?

If the clock skew is 5 minutes then shouldn't there be some cache memory holding all requests from the last 5 minutes so that if the same authenticator arrives again TGS will reject it since the same timestamp already exists in its cache ? (because a valid client sending a second request would generate a new timestamp while an attacker will use an existing timestamp) ?

Is there such a cache for the case of a replay attack within the allowed time range ?

In Kerberos V5 a replay cache was introduced which keeps track of all authenticators recently presented to a service (recently = the size of the clock skew). If a duplicate authentication request is detected in the replay cache, an error message is sent to the application program.


Can Javascript/Flash verify the SSL connection to prevent "SSL Inspection"? I'd like to determine if an SSL webpage is being debugged through Fiddler, or if it's going through an SSL Proxy.

So some people may ask

  What is the point of re-validating SSL using javascript?

My goal is to know when a connection is subject to 3rd party interception as mentioned in this answer. The vulnerability is that passwords may be exposed, and user sessions are exposed as well.  All of this is possible when malicious software, or corporate IT policy dictates SSL interception and monitoring.

  What can be done if a SSL connection is being intercepted?

Depending on the sensitivity of the application, and if two-factor authentication is being used, I may programatically block the connection or limit access to certain parts of the website.  I may also place a banner notification indicating the security risk of using that kiosk.  ...Or I may allow the user to add an "exception", granted they understand the risks.

My Question:

  Can Javascript check the current SSL certificate details, including CA chain?

I think the right way to approach this is to look at the certificate's issuer, and look at the rest of the certificate chain.  The next step would be to list through each cert in the chain and see if any of those CA's are equal to what's root CA's are publicly trusted.  I want to specifically exclude what additional certificates that user may have added themselves to their local computer.

I'm hoping people on security.stackexchange.com will offer ideas on how to approach this.

  If Javascript can't validate the current SSL connection, what are the alternatives?

Since this may, or may not be possible in a pure JavaScript solution, I tagged this question with Flash since it should be able to accomplish this, and send a response back to Javascript.

If anyone has Java ME experience, please mention if this is possible.  Same goes for any other widely deployed plug in.

Source code for the relevant technology is appreciated.

You asked about alternatives.  Quite frankly, this is a tough one: if someone is playing man-in-the-middle on your SSL session, and the user hasn't noticed or has allowed it to proceed, you're in a really tough spot.  However, I'll try to brainstorm some alternatives that you could consider, if Javascript isn't able to check the cert the server provided on this HTTPS connection.  Both of these ideas are far from perfect, at best, but I'll pass them along in case they help.

Idea 1. Don't trust the browser. One possible alternative is to use two-factor authentication and confirmation, so that you are not 100% reliant upon the browser session.  For instance, for online banking applications, if the user performs a sensitive operation, the server could send the user's cellphone a SMS message listing the transaction information ("pay $100 to AT&T?  to approve, enter this PIN: 2781"), and then require the user to respond with their approval or enter the PIN into their browser session.  However, I realize this is annoying and inconvenient for users.

Idea 2. Raw sockets. Another possibility you could explore: use Flash or Java to open a raw socket to some TCP port on the server.  If this is not intercepted/man-in-the-middled by the proxy, you now have a number of options to detect the proxy.  One simple detection strategy: if the server notices that the source IP address associated with the raw socket is different from the source IP address associated with this HTTPS connection.  (However this might generate false alarms...)  You might also be able to bypass the proxy without Flash or Java by using some other protocol handler that the browser recognizes but the proxy doesn't intercept, such as ftp:// or somesuch.


Multi user symmetric key encryption I realize SIMILAR questions have been asked before but I'm looking for certain specifics I can't seem to find elsewhere. The following question closely resembles mine but falls short for me on details: Encryption strategies for multi users access in production systems.

I'm creating an application that allows users to add content, which is then encrypted
and stored in a database using a content key. This content key is a randomly generated string of 32 characters (since rijndael-256 doesn't seem to support more than 32 characters, or certain utf-8 characters for that matter, but that subject is outside the scope of this question). The content key is also stored in the database, encrypted with the private application key.

What doesn't make sense to me is that next, according to similar posts, each user that should have access to the encrypted content should be given a unique key.

How is this safer than let's say creating a reference for every encrypted row stating which users are allowed to view the encrypted content based on the user's id?

What I'm looking for is a detailed explanation on how to tackle these kind of situations, and furthermore what the keys and passwords (if any) should be derived of.

And how does that table grant them access to the files?  The entire point of encryption should be that the server can't access the files even if it wanted to.  If you just have the data keys stored in a table with a list of who is allowed to access the key, the server can now access the files and encryption is pointless.

Instead, a copy of the content key for the file is encrypted with the public key of the user being granted access and stored in that users keyring (a table much like you described for saying who has access, but storing access keys rather than a simple permission lookup).  Without that user logging in and providing their password, their private key can't be decrypted, the content key can't be decrypted and the file can't be accessed using their copy of the content key.

If you want to reject access, you simply remove the content key from their keyring and destroy it (provided that the server has never leaked the content key while they had access, slightly more secure would be to actually change the content key, but that gets costly as it requires re-encrypting the file and all the other keyrings).


What's the diff between blocking a port with a firewall and not starting a service on that port in the first place? I was considering setting up a software firewall (pf) on my web server and did some research on them. Were I to do it, it'd involve basically blocking connections to all ports except 80, 443, and the non-standard port I'm using for SSH connections.

But seeing as how my server already only has services running on those ports anyway, would it just be pointless? I don't really have a need right now to region-block IPs or anything complex like that.

In simple words that someone with a not-so-complete understanding of IP networking can understand, would it still be useful for me to configure a firewall in this way? How, functionally, is it different from just continuing to not run services on the ports I would block?

TL;DR

It protects against having to manually configure services to only listen on localhost, as you have to manually allow them network connectivity, and it increases the effort an attacker must exert to recon your box. This means it's an effective tool both against attackers and poor configuration.  Yes, you should run a firewall.

Detail

Ports have 2 main states:

Open (Service is listening)
Closed (There is nothing listening)

You appear to be familiar with the two states - ports default to "closed", switching to "open" if there is a service listening.  It's very fast to enumerate both open and closed ports - the OS will actually send a response saying either "there is a service here" (port is open), or one saying "there is no service here" (port is closed).

If you use a firewall, it provides the option to filter ports.  For filtered ports, the OS does not respond at all.  This means an attacker must invest more time to determine port states, as they have no way to know if the computer didn't send any response, or if the response was lost in transit.

Additionally, if you're running a firewall, you protect yourself against accidentally exposing additional services to the Internet.

I've included a sample scan of my desktop with my firewall off (pay special attention to the number of ports discovered, and how long the scan took):

$ nmap 192.168.1.26

Starting Nmap 6.40 ( http://nmap.org ) at 2015-01-24 21:41 EST
Nmap scan report for TehPwner (192.168.1.26)
Host is up (0.00017s latency).
Not shown: 987 closed ports
PORT      STATE SERVICE
135/tcp   open  msrpc
139/tcp   open  netbios-ssn
445/tcp   open  microsoft-ds
902/tcp   open  iss-realsecure
912/tcp   open  apex-mesh
2869/tcp  open  icslap
5357/tcp  open  wsdapi
8081/tcp  open  blackice-icecap
49152/tcp open  unknown
49153/tcp open  unknown
49154/tcp open  unknown
49163/tcp open  unknown
49176/tcp open  unknown

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

Now I've enabled my firewall:

$ nmap 192.168.1.26

Starting Nmap 6.40 ( http://nmap.org ) at 2015-01-24 21:42 EST
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn

Nmap done: 1 IP address (0 hosts up) scanned in 3.03 seconds

Once more, skipping the ping probe:

$ nmap 192.168.1.26 -Pn

Starting Nmap 6.40 ( http://nmap.org ) at 2015-01-24 21:42 EST
Nmap scan report for TehPwner (192.168.1.26)
Host is up (0.00090s latency).
Not shown: 996 filtered ports
PORT     STATE SERVICE
902/tcp  open  iss-realsecure
912/tcp  open  apex-mesh
2869/tcp open  icslap
5357/tcp open  wsdapi

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


Should I change format and/or add data to image files in a file upload? I am designing an image upload platform to my website and was thinking about a few recommendations I found online which were NOT outlined in the OWASP unrestricted file upload list.

Those security solutions:

Changing file format (e.g from .jpeg to .bmp or .png to .bmp etc).
Rendering image / compressing it and re-uploading the new file

Are those two solutions useful? If so - why? If I decided to use those techniques, in case of time vs. security, are both solutions worthy?

By changing format, a malicious user cannot force a certain behaviour by the client. If there is a jpeg vulnerability in a well-known viewer, then by changing the image to png, the malicious actor cannot use that technique.

Re-rendering the image does the same thing. A malicious actor cannot embed malicious code to affect your users.

Changing format and re-rendering should not take much time, but you have to budget your server resources so that you do not run out of resources.


How to do arp spoofing on the virtual machine? (Against host) I have an Ubuntu host and a Kali guest, I want to do spoofing over the host network but when I tried to do spoofing it recognizes only the network between guests.

Is there any solution?

Maybe that is because your Kali machine in on "host-only" mode.

Have you configured the guest machine to be on "bridge " mode ?
This way, both your machines will be on the same network.
And the attack should work.
However,be aware that preforming the attack on virtual machine may effect the attack(specially when you preform ARP spoofing and DNS hijacking  with ettercap)


Identical lanman hashes on AD accounts? I ran metasploit's smart_hashdump module against my (2008r2) domain controllers, trying to find any accounts that may still have lanman hashes in place. These should have been disabled long ago. I'm just doing some cleanup before this years penetration testing and I wanted to find anything that had been missed.

I'm a bit confused by the output I'm seeing. All of my accounts have exact same hash in that column - aad3bb43....404ee.

I've seen a couple references to hashes beginning with aad3b43 being blank, but nothing about all these hashes being identical.

I take it that this value corresponds to some kind of internal 'disabled' state? I just want to be sure I'm understanding what I'm viewing.

EDIT:

@Izsi -

The 7 null bytes describes exactly what I'm seeing.
We've long since had the lan man authentication level set to 5 and the don't use lm at next password change set so it isn't a matter of having no password set, or even a problem with a few users using short passwords.

I mostly wanted to be sure that the uniformity was intentional. I work with password hashes fairly regularly and almost never see duplicate entries. It just plain looked weird. I didn't think about the lm hash not using a salt and a fixed password always returning the same value. Makes perfect sense now. Thanks a ton.

The LM hash does not use a salt, and therefore any identical passwords will have identical hash values.

Another thing to bear in mind is that the LM hash doesn't process the password as a whole. Instead, it null-pads it to 14 characters (if needed), then splits that value into 7-character chunks and hashes each before sticking them back together. Thus, if the first 7 characters are identical to the last 7, the first 8 bytes of the LM hash will match the last 8.

The LM hash value for 7 null characters is AAD3B435B51404EE. Therefore a password less than 8 characters long will end with AAD3B435B51404EE, and an empty password will always (since LM hashing doesn't use salt) be exactly AAD3B435B51404EEAAD3B435B51404EE.

There is one more caveat, however. LM hashing does not at all support passwords of 15 characters or greater. When this is encountered, the user may receive a prompt asking them to confirm they want to use a password that will be incompatible with older (LM hash dependent) software. Then, the system will store a null LM hash for that user. I personally recommend that people use 15+ characters in their passwords for precisely this reason.

So, it is possible that those accounts you're looking at have completely empty passwords. In that case, those users probably deserve a stern talking to. It's also possible (and perhaps more likely) that those accounts are actually using longer passwords than most others, which should be applauded!


Is it safe to store a JWT in sessionStorage? This article from Auth0 recommend storing the JWT locally in a local storage (or cookie). But this article from OWASP recommend not to story any sensitive data locally (not even sessionStorage)

So, is it safe to store the JWT token locally or not?

How bizarre! I asked basically the same question about a month ago.

In the end, we decided that using localstorage for the JWT token was ok, as long as we also did the following on the HTTP level:

Ensure the entire site was served over HTTPS
Ensure the use of HSTS
Ensure that, once live, only the actual redirect URL was included in the Auth0 rules, as well as our source code

We use the Angular CLI. It turns out that, despite the tree shaking provided by WebPack, unused variables still show up in the compiled source code, for example localhost:4200
Make sure that there are no localhost URl's actually on Auth0 (on the allowed redirect page, for your client). Make a seperate Auth0 account for testing

Add the X-Frame-Options header to every HTTP response, and set it to Deny
Set X-XSS-Protection to 1
Set X-Content-Type-Options to nosniff
Make sure Content-Security-Policy is restricted to your own domain name, and any CDN's you may be pulling scripts in from
Set Referrer-Policy to same-origin
Limit the JWT expiry on Auth0 to 1 hour

The above will give you an A/A+ on securityheaders.io, and will prevent the most common attacks (somebody embedding your website in an iframe, and extracting data from localstorage, for example).


Internet security - how long does the NSA store data? I am aware that the NSA collects unheard of amounts of data via cable-tapping programs such as OAKSTAR/STORMBREW/BLARNEY/FAIRVIEW and by other means. I also know that the NSA has very large and expensive data centers that can store a lot of information. In the light of that, how long do they actually keep this data? I feel very uncomfortable (and I am sure I am not the only one) thinking that they have all of my personal details and sensitive information in their data centers.

Most likely none of that would be ever made public or even peeked upon by anyone, because I am nothing but a drop in the sea, but say that I become a significant politician at some point. They could have blackmail material from some distant point in my past. I think that will be a concern for this entire generation of internet users, because in the past there was no such thing as the internet and privacy concerns.

Is information security even a thing anymore? With methods of bypassing encryption and so on... but that's another topic.

According to General Alexander when he started the digging for the Utah facility, he said the goal was to "capture as much as we can, and keep it as long as we can"

In other articles, I have seen discussion that they are especially interested in keeping encrypted communications longer, so if one day they get the key they will have the whole history of communications of a specific target.  And you can bet they or the FBI keep a special eye on Tor communications.

They do utilize minimization, so they don't have to store irrelevant information.  So your letters to grandma are probably not stored very long at all.

Now, keep in mind that as of the latest legislative move, it is the phone companies themselves that store most of it.  It hasn't been made clear exactly what the NSA stores, other than that they have said they will request information from the phone companies for specific targets at specific times, following legal procedures involving the special Foreign Surveillance court.

Sure, information security is a thing.  But mostly it is not the NSA you want to worry about.

The big worry is the idiots like those kids that sniffed credit card numbers from a large store from their car in the parking lot.  Or someone sniffing packets at an airport.  Or at a McDonalds.

You definitely want to use HTTPS-Everywhere in Chrome, at the very least.  Or maybe a VPN service like Tunnelbear.  Just enough security to keep the casual script kiddies from getting into your business.


What to do if bug bounty program is unresponsive? Over a year ago, I have reported a few security vulnerabilities to one of the top bug bounty programs on HackerOne. All of them have been quickly triaged as critical, but no progress was made towards their resolution. I have repeatedly pinged them for update, but every time I have received evasive answers. The program response efficiency metrics seem to indicate that is not the case with other reports, or at least some of them. What should I do in this situation? I have already tried HackerOne mediation system with no success.

As many experts would agree, it is time you follow the (not so desireable) second-part of resposible disclosure: Give the security team a timeframe of 1-3 months, after wich you will disclose the vulnerability.
Responsible disclosure isn't only about communicating with the developer team to fix their security issues; It is about evaluating on your own just how much of an impact the vulnerability has, and how much time is reasonable to fix it. It would be unfair to the users to keep a critical vulnerability un-fixed and un-reported, given how much of an impact it would have if actively exploited. Sadly, sometimes the only way of making a company react, is by publishing your findings.
This was not legal advice; This was not advice; I am not responsible for the actions of those who read this.


How to fuzz service with sending bad data? I am reading a post about fuzzer in Python, here is the code:

# Import the required modulees the script will leverage
# This lets us use the functions in the modules instead of writing the code from scratch
import sys, socket
from time import sleep

# set first argument given at CLI to 'target' variable
target = sys.argv[1]
# create string of 50 A's '\x41'
buff = '\x41'*50

# loop through sending in a buffer with an increasing length by 50 A's
while True:
  # The "try - except" catches the programs error and takes our defined action
  try:
    # Make a connection to target system on TCP/21
    s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    s.settimeout(2)
    s.connect((target,21))
    s.recv(1024)

    print "Sending buffer with length: "+str(len(buff))
    # Send in string 'USER' + the string 'buff'
    s.send("USER "+buff+"\r\n")
    s.close()
    sleep(1)
    # Increase the buff string by 50 A's and then the loop continues
    buff = buff + '\x41'*50

  except: # If we fail to connect to the server, we assume its crashed and print the statement below
    print "[+] Crash occured with buffer length: "+str(len(buff)-50)
    sys.exit()

What confused me is why sending the data with an increasing length, or something like the code above, will crash the service?

If the server has a poorly implemented buffer somewhere, it may cause a crash if the data exceeds what the buffer was initially set up to expect. In low level languages in C++, it is easy to set up poorly defined buffers this way, and a crash is good evidence that an exploitable error might exist.

https://www.owasp.org/index.php/Buffer_overflow_attack

(from the above)

 #include <stdio.h>
  int main(int argc, char **argv)
  {
  char buf[8]; // buffer for eight characters
  gets(buf); // read from stdio (sensitive function!)
  printf("%s\n", buf); // print out data stored in buf
  return 0; // 0 as return value
  }

If the actual input exceeds 8, there will be issues, although not necessarily a crash. This is a wide topic, but the most important thing to know is that if your service is crashing on large values, then you potentially have a security issue.


Code Signing Confusion I usually make free windows applications, now I want to digitally sign them. So users can be sure that its from me. But instead of buying the code signing certificate, I thought I may create my own. But then again, if I can create, then anybody can create with same info as mine. However I don't actually understand how this whole thing works at end user.

Lets say I have a string in my application, and I digitally sign it. But then some other guy changes that string and he create his own certificate with same company name as mine then signs it. How the end user will know it's from him, not from me. Or Its doesn't work this way?

As far as I understood, when creating own certificate, it needs to be added in some sort of store so Windows can recognize it ? That means, if I create my own certificate, all end users will need to add my certificate as well in their Computers?
And if that's true, then how can I be sure that if I purchase the certificate, it will be available at user end. What if its not there?

In order to tell the end user that the YOU are the actual owner of the app, you MUST buy a certificate from a trusted third party (a party which is also trusted by Windows). These third parties are called Certificate Authorities (CA). Here's how you can get a certificate from a CA (according to MSDN).

  How the end user will know its from him, not from me. Or Its doesnt
  work this way ?

Now, one of the responsibilities of a CA is to verify your identification before issuing you a certificate. Therefore, no "other guy" can get a valid certificate with your identity from a CA. Your certificate is verified by the Windows through a process called Chain of Trust verification. You can find more details about the process here.

  As far as I understood, when creating own certificate, it needs to be
  added in some sort of store so Windows can recognize it ?

I think the store you are talking about here is the Microsoft's Certificate Store Technology which is basically used to store all your certificates, so that you can choose them while signing. Also, you don't have to worry about availability of your certificate at end user. Since your certificate is signed by the CA (CA trusts you) and Microsoft trusts that Certificate Authority and End user trusts Microsoft, user will have no problem identifying that the code belongs to you.