Thursday, February 25, 2016

Using cheat for getting help with unix commands.


There are lots of tools and commands in unix systems for various purposes. Some tools we need in our day to day activities but some tools are using very rarely. For both of these instances most of time we are facing forgetting the commands that relevant to a tool or a command. Even a tool that we are using daily sometimes we are getting trouble when we execute some commands we have not been used previously. And also sometimes even if we know the command we may forgot what actual does that command. So to identify those things there is a great tool called Cheat.

Using cheat in terminal you can get the usage of most of the unix tools and commands. And it's not like man. It gives us "what you want to do? and here is the command for it". 

How to install cheat?
If you have installed python simply run the following command

Tuesday, February 23, 2016

Config CentOS as Gateway / Firewall mode

We can use Cent OS as a gateway in a network to implement other function as a firewall also. So here are steps.

Firstly if you have not installed iptables install it as follows.

Debian

apt-get install iptables-services

Redhat

yum install iptables-services

It is important to install iptables-services packages.


1) Load the modules.

This is not need to done in newer linux versions.

modprobe ip_conntrack
modprobe ip_conntrack_ftp
modprobe ip_conntrack_irc
modprobe ip_nat_ftp

2) Disable ECN if enabled.

Linux shell with effective way (ways to use it)

Here we are going to focus on linux / unix shell with specific symbols which we can use the shell in effective manner.

The symbols are,
|, \ , &, &&, [], [[]], (), {} 

These symbols are very usefull in bash.

Using pipe symbol in shell

| the pipe sign can use to pipe the output of a command. simply it's forwarding what have in stdout in to stdin.

ex:
ls /etc | grep gtk

here we get the output of the ls /etc and put it into the grep gtk  command as an input to that command.


Logical Operators.


Friday, January 22, 2016

How to install Ubuntu Core and work with it

Ubuntu is the most popular Linux distro which handled by canonicals. It offers several installations which is customized such as gnome-ubuntu, ubuntu-core. Ubuntu core is a light version of ubuntu which is not a installation iso but its a file system to work with linux in minimal resources.

After you setup the Ubuntu core you get only the file system with Ubuntu repos, shell, grub and other initial items for linux. It is very good to try this out because this gives you a good knowledge of the linux file system how format the disk, how to install grub, how make the disk bootable, how will kernel interact with grub and so on.

Firstly you have to download the Ubuntu-core rootfs (root file system). You can download the ubuntu 14.04.3-core root file system in this link http://cdimage.ubuntu.com/ubuntu-core/releases/14.04/release/

Thursday, November 12, 2015

How to use C code in Python

Python and C combination is brilliant for programmers specially who writing network tools and exploits. For this purpose there are many ways to use both of them in one code and make the use of both languages. Previous days I was looking for a easy way(not easy actually fast way to approach my object which is make use of c code inside a python code) to do this. I was noticed there are many ways to do this. Some of them are,

  1. According to Extending Python with C doc (https://docs.python.org/2/extending/extending.html).
  2. Some languages has built in combine with features of these two languages such as Pyrex, Cython.
  3. Using ctype module.
  4. Using a SWIG (Simple Wrapper Interface Generator)

Monday, June 15, 2015

How to make a remote desktop connection on Linux and Windows

Here we are going to talk about how to make remote desktop connections in Linux and Windows OSs. I think you know how to establish a RDP connection to windows machine from another windows machine. So firstly i will talk about how to establish a RDP connection to a Windows machine from Linux machine.

Note : This demonstration is for Ubuntu and Kali like linux machines

RDP from Windows to Linux
  
Get the terminal. And type apt-get install xrdp

It will install the XRDP on your linux system. Then type service start xrdp
This will start the XRDP service on your linux machine.

Now in the terminal type whoami. This will show you the host name of your linux. Remember it. And type ifconfig find your ip address and keep in mind.
Go to your Windows machine and get run and type mstsc. Type your linux machine's IP and click on connect. Then a windows will come with black background popup for input username and password. Make sure in front of the Module has selected the Sesman-Xvnc. On the Username field type the Hostname of your linux. On the password type it's password (login password for your linux). Click on OK. Then RDP connection to the linux machine will come.

RDP from Linux to Windows

Friday, June 12, 2015

How to remove startups from registry


You know that it's not sufficient to avoid starting programs on startup by disabling the programs in startup option. They live in the registry. Some times those registries also should removed in-order to avoid them starting on the startup.

Get RUN and type regedit.

Now registry will open.You should go through two things. When we installing app it could be a 32 bit one or 64 bit one. The startup registry files of 32 bits apps will build in HKLM or HKCU (HKLM-HKEY_LOCAL_MACHINE , HKCU-HKEY_CURRENT_USER) , HKLM/Software/Wow6432node/Microsoft/Windows/Current Version/Run
or
HKCU/Software/Wow6432node/Microsoft/Windows/Current Version/Run

Startup registry files of 64 bit apps will build in

HKLM/Software/Microsoft/Windows/Current Version/Run
or
HKCU/Software/Microsoft/Windows/Current Version/Run

Deleting the remaining registry files of a app that you dont want to run on startup will work well. Specially with the malwares. Most malwares created to execute at the startup. Deleting registry files of that malware like this would end up the malware activities on your computer toatally.