Translate

Saturday 14 December 2013

how to configure pptp and freeradius




pptp authentication using freeradius you can following tutorials.

For freeradius setup : http://safesrv.net/install-and-setup-freeradius-on-centos-5/
For pptpd setup      : http://safesrv.net/setup-pptp-and-freeradius-on-centos-5/

After radius server installation test radius server locally and remote server. If response is positive then you are done with radius server. Else add nas table to radius server if is it is already not included or not already configured.

Try not to jump on another server deployment util you are not completely deployed previous one.

If you are unable to communicate between user , VPN server and freeRADIUS server then check IPTABLES and port forwarding. And also check that in VPN server configuration ,  radius server ip is defined.
Also confirm that in freeRADIUS configuaration ,   VPN server ip is listed in clients.
After successfull setup of these two servers following are possible issues you may face.

Possible issue :
Issue 1 : Carefully read tutorial and do configuration of right files. Because some directories contains file names with little difference for example options.pptpd and options-pptpd.

Issue 2 : User requires some authentications like pap , chap , mschap etc. User sends authentication requests to VPN server and VPN sever forward this request to freeRADIUS server to authenticate user.

Authentication will only be successfull if user's required authentications matches with /etc/ppp/pptpd-options configuration. In /etc/ppp/options-pptpd  authentications are written like this require-pap refuse-pap etc.

Still having problem please read this freeradius official tutorial http://wiki.freeradius.org/guide/PopTop-HOWTO   .






pptp Unknown attribute 47. Modem hang up



You are setting up PPTP Using freeRADIUS server.
freeRADIUS server is ready to process requests. And PPTP is accepting connections.
Windows clients are working fine and browsing successfully.
Ubuntu PPTP clients connect to server but in less than 10 sec they disconnect.
Server logs:
Server log is showing modem hangup.
Unknown attribute 47.
Unknown attribute 48.
Solution:
This is client side error. The server is working fine. There is no need to check server.
This is maximum transmission unit error on client side. (MTU , the size of largest protocol data unit)
To solve this issue only change MTU of interface through which you are connected to internet.
Enter following command in terminal.
sudo ifconfig eth0 mtu 1400
Change eth0 to interface from which you are connected to internet. MTU value of 1400 at client side. PPTP is connected and not disconneting any more. No modem hang up error on client side.

openVPN Bad LZO decompression header byte

Scenario:
You have successfully deployed freeRADIUS and openVPN.
OpenVPN client successfully connects to openVPN server
Windows openVPN client can seccessfully connect to the server and can brwose sites successfully.

Issue:
But ubuntu clients can not browse sites successfully.
And also disconnects in less than 30 seconds.

Logs:
Used logs are
/var/log/messages
/etc/openvpn/1194.logs

/var/log/openvpn.log shows the basic issue.
*Bad LZO decompression header byte: 69*

Solution:
Before connecting openVPN client correct the openVPN configuration.
Check (Tick) lozo compression in advanced settings of vpnClient configuration in Ubuntu client.


Client can browse site successfully but IP of client not changing. L2TP


You have successfully deployed freeRADIUS and L2TP.
Windows L2TP client successfully connects to L2TP server

Issue:
Client can browse site successfully but IP of client not changing.

Solution
In /etc/racoon/psk.txt
There is given ( * ) which mentioned for Iphone or android clients. Give both l2tp server ip and * with secret key also.

Now connect to server. It should work now. :)



w3af : ImportError: cannot import name process_pdf




w3af Installing w3af.

- after cloaning w3af from git clone https://github.com/andresriancho/w3af.git running ./w3af shows install missing packages of OS and python.
- w3af generate script of missing requirements in /tmp/ directory.
- Missing packages installed by running script.
- some packages are not installed.
- pysvn and scapy installed manually by pip install http://link-to-package
Prolem:
after running ./w3af_console it shows pdf_process error at last.
ImportError: cannot import name process_pdf
Traceback (most recent call last):
File "./w3af_console", line 25, in <module>
from core.ui.console.console_ui import ConsoleUI
File "/home/w3af/core/ui/console/console_ui.py", line 42, in <module>
from core.controllers.w3afCore import w3afCore
File "/home/w3af/core/controllers/w3afCore.py", line 36, in <module>
from core.controllers.core_helpers.strategy import w3af_core_strategy
File "/home/w3af/core/controllers/core_helpers/strategy.py", line 30, in <module>
from core.data.url.extended_urllib import MAX_ERROR_COUNT
File "/home/w3af/core/data/url/extended_urllib.py", line 45, in <module>
from core.data.parsers.HTTPRequestParser import HTTPRequestParser
File "/home/w3af/core/data/parsers/HTTPRequestParser.py", line 26, in <module>
from core.data.request.factory import create_fuzzable_request_from_parts
File "/home/w3af/core/data/request/factory.py", line 29, in <module>
import core.data.parsers.parser_cache as parser_cache
File "/home/w3af/core/data/parsers/parser_cache.py", line 26, in <module>
import core.data.parsers.document_parser as DocumentParser
File "/home/w3af/core/data/parsers/document_parser.py", line 25, in <module>
from core.data.parsers.pdf import PDFParser, pdf_to_text
File "/home/w3af/core/data/parsers/pdf.py", line 26, in <module>
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter, process_pdf
ImportError: cannot import name process_pdf

Solution:
It is only due to this missing package phply

w3af plugins.grep.clamav: "No module named six"."

If you are getting this error on running ./w3af_console

Error while reading plugin options: "There was an error while importing plugins.grep.clamav: "No module named six"."

then
Solution :

apt-get install python-six :)

w3af not sending email , not even saving any configurations.


If w3af not saving any configurations then there is issue which can be resolved by recloaning w3af. And following instructions on console. Console might say to install phply. A command to install will also be there.

If w3af not sending email then make sure following.

Make sure mailutils and sendmail is installed.
Use sender domain.
Sender domain other than gmail. For example abc@yahoo.com.
Still not receiving email in gmail. Gmail might have black listed your ip. Change sender and receiver emails of yahoo domain.
Still having trouble.
Checking of logs is necessary.
/var/log/syslog
/var/log/mail.log

Saturday 30 November 2013

w3af Discovery plugin missing. w3af version 1.6

May be you see this message on running latest cloned w3af. (version 1.6)
The profile you are trying to load (fast_scan) seems to be outdated, this is a common issue which happens when the framework is updated and one of its plugins adds/removes one of the configuration parameters referenced by a profile, or the plugin is removed all together.
So dont worry here is solution.

-- w3af installation guide is good document to study how to install w3af.
-- w3af installation needs several python plugins to work.
-- use pip or easy_install to install these packages.
-- Details of these packages are given in Guide.
-- pdfminer is also a python plugin required.
-- after installation when running ./w3af_console. w3af automatically console generate bash script to install remaining plugins.
-- the problem was in after running ./w3af_console , profiles --> use fast_scan w3af shows above message.
-- Searching the problem results in following link. You can also read from this link but i have also mentioned problem and solution in this post.
-- This message is usually due to that you have several attempts to install w3af on ubuntu.
--Problem was that latest cloned w3af use previous installation files which are in .w3af directory.
-- After removing this directory rm -r .w3af.. ./w3af_console works fine.
-- w3af installation is complete on ubuntu
-- w3af may say that again some plugin is missing. At least in my case it says that. But dont worry just install missing plugin from script automatically created by w3af in /tmp/ directory or read the message carefully it will guide you where is bash script placed by w3af.
-- simply run script using by moving to directory and entering ./dependency_fileName.sh. w3af should work now.
-- If you still have issue then you can also post new issue by registering into github and using this link. https://github.com/andresriancho/w3af/issues/144
click on new issue. write all used method of installation and python version ,installed python packages , gtk version , and error message as well. 



Monday 11 November 2013

How to download Videos from ubuntu ..Donwload Manager for Ubuntu ,

Note : This method will not work for anonymous web browsing. 
To download videos form ubuntu and to use a good download manager for ubuntu follow these steps.
(1) Download Uget download manager from here. Download debian version for easy installation.
(2) Install FlashGot add-on in firefox from firefox add-on site.


Sunday 10 November 2013

SFTP Server setup , with SFTP restricted Account , SFTP user Restricted to one directory only

Here is complete method to create setup SFTP server on ubuntu server. This method will

Setup SFTP server on ubunut server.
Create SFTP user.
SFTP user will be restricted to one directory only.
SFTP user will not have SSH Secure Shell Access.

SFTP server will access server using SSH. So to install SSH .

sudo apt-get install openssh-server

Edit   /etc/ssh/sshd_config with your favourit editor. I am using vim for this procedure and you can use yours like nano. Add this at the end of file. testuser is username of sftp user.

UsePAM yes
Match User testuser
ChrootDirectory %h
ForceCommand internal-sftp
X11Forwarding no
AllowTCPForwarding no

Save it and enter following commands to terminal.

To create testuser enter. -m flag will create root directory in /home/ by default. To set it to your desired directory use -d flag (e.g. useradd -d /home/user/myDirectory testuser).
useradd -m testuser

Add user to group sftp. (To create group sftp enter in terminal "groupadd sftp")
usermod -G sftp testuser

The following command is so much important. It defines the login shell of testuser. If it is not set then shell for test user will be default. Restrict user to its home directory only. This will also restrict user to access SSH access.
 usermod -s /bin/false testuser

Change owner so that he can have full access to his directory.
NOTE : This is root directory ROOT should be owner of this directory. To upload and download files create sub directory  with ("chown testuser:sftp /home/testuser/newDirectory")
 chown root:root /home/testuser

Change mod to 755 . Read , Write , execute for user. Read and execute for sftp group members. Read and execute for all other users.
 chmod 0755 /home/testuser

To set password for testuser enter.
passwd testuser

and do not forget to restart your sshd.
/etc/init.d/ssh restart

Test Your sftp setup

To test your sftp setup on LAN or WAN. Install filezilla on other system and enter the IP of your sftp server. From menu bar click on site manager and select sftp as file transfer. Leave port number blank, it will be default to 22. Enter user name and password for sftp user which you created on target machine. testuser in my case.



Troubleshooting :
Before testing remotely. Test newly created sftp user on localhost by entering this cammand

sftp testuser@localhost 

then enter password. If successful this error comes Request for subsystem 'sftp' failed on channel 0

comment subsystem line in /etc/ssh/sshd_config. And write this one  
Subsystem sftp internal-sftp
 
To understand this error visit this .

Comments , Suggestions , Questions and Corrections are Welcome :) 





Tuesday 27 August 2013

How to Change Desktop Environment in Ubuntu 13.04

Changing Desktop Environment in Ubuntu is easy. Rather than installing Linux Mint for Cinnamon Desktop Environment. You can easily get Cinnamon Desktop Environment or any other Desktop Environment to Ubuntu. Like KDE , XFCE , GINOME , UNITY etc..

Default Desktop environment for ubuntu is Unity.

GINOME:
sudo apt-get install gnome 




CINNAMON:
sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
sudo apt-get update
sudo apt-get install cinnamon


KDE:
 sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
sudo apt-get update
sudo apt-get install cinnamon nemo




How to open specific Desktop Environment....

Reboot of log off computer ...

At Login Screen there will be an icon at User name in ubuntu 13.04. Click this icon and Select your desired Desktop Environment.

How to Root at terminal : linux Cinnamon , linux KDE , linux Gnome or any other environment

(1)Press Alt + Ctrl + T to open terminal .
(2)Type and enter

                                sudo -s
Enter password ..

You are done.. :)

Sunday 23 June 2013

too many patterns Gmail or any other Account not working for Samsung Galaxy SL i9003

If your mobile is locked and Gmail or any other account is not working even you have disabled USB debugging Here is the simple method to make your mobile work again.

WARNING : THIS METHOD WILL DELETE ALL YOUR CONTACTS , MESSAGES AND ALL MOBILE DATA. DATA FROM YOUR SD CARD WILL BE SAFE.


1) Remove Battery from mobile
2) Reinstall Battery into mobile
3) Keep pressed Home Button + Decrease Volume Button.
4) Do not release these keys (Home button + Decrease Volume) and then start your phone by pressing Power Button.
 Now you will see the mobile is giving you option to backup and restore , move menu selection up and down by pressing volume up and Down Button Select BACKUP/ RESTORE option and then Select " yes (restore mobile)".

Enjoy.. Usually when you go to mobile. They do same thing and charge you much..



Friday 31 May 2013

Optimize Laptop Wireless Card performance in windows

Wlan optimizer is free software working fine. It disable the network activity scan performed by computer after regular internals of time. This Scan may cause to increase ping to disturb voice communication , games or video sharing software  / services.
It also seems to working fine when network router signal strength is low or fair.


You can download Wlan Optimizer from here. You love it.


Thursday 9 May 2013

Get Desktop Version of Skype For windows 8

Here is Link to Download Desktop version of Skype. You can use it for Windows 8 as well. This will looks like..

Windows 8 Get Start Menu Button Back, Use Both start Menues Windows 8 and older one ..

Pokki is Free App which can help you to get your favourit windows 7  start menu interface back.
Just install it and get your start menu like this


Good News...!! You Can use both of Start menu interfaces.
" Windows 8 default start menu is still there At Left Bottom Corner."

Wednesday 24 April 2013

Linux Video Download Grabber Really Easy For Firefox

New Users of Ubuntu may face very common problem of Grabber for their Browser.
If you are using Firefox then it is very easy to install Grabber for video downloading.

Flash Video Downloader is An ADDON of Firefox . Really cool for downloading youtube video and other flash videos.

Icon in your Browser will look like .



just play online video and click this icon . It will simply Download that video .

Installing Other Download Manager may be a wast of time for new users. Because there may be compatibility and installation issues.


Saturday 13 April 2013

Drag and Drop in Eclipse

How to use drag and drop in eclipse....
There are several plugins available for drag and drop for eclipse .

like WindowsBuilder , Swing GUI desinger etc. install these plugins to eclipse For drag and drop their update site links are available here.

WindowsBuilder 
window GUI desinger

How to install Plugins in eclipse?

it is easy to install plugins to eclipse.
1) First of all you have to find the update site for plugin from eclipse site or plugin developer site.
2) To find the update site type in Google (update site for Maven) Maven is plugin used when developing Java Enterprise applications.
3)Open help form menu bar .
4) Click Install New Software past update site link in there and install the plugin by clicking next and finish.

Friday 12 April 2013

How to install updates in linux Mint from terminal

to install updates from terminal type in terminal

su

give password and enter . this command will run the terminal as administrator

sudo apt-get update


Wednesday 10 April 2013

Start Oracle Service Manually

Some time booting  is very heavy and you may have to disable some services from by running msconfig command from run or start up search from windows 7
and then press services tab for disable the oracle services. After apply it may require boot up
 this process will save almost 0.2 to 0.3 GB ram. But disable the services very carefully because disabling some sensitive services may cause the system to behave abnormally. The guideline for it to do not disable microsoft services. A checkbox is also available for it to show non microsoft services. 

WARNING:
The problem you will face after disabling oracle services is that you will not able to run oracle database. So now if you want to save system memory and run oracle on requirement as well so you can start oracle service manually by starting Component Services 

go to start in win 7 and type Component Services

Press Services from left 





go to properties of each service and make it manually start. Apply it and right click the service and start it manually.









 Now to save the system memory and making the system to boot not so much heavy then you have to start this service like this every time if you want to start oracle database.

Do not confuse with sc or net service commands of cmd.