banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Messages posted by: HoS  XML
Profile for HoS Messages posted by HoS [ number of posts not being displayed on this page: 0 ]
 
Sự tình là thế này, chiều nay sau khi rút dây cáp mạng ra khỏi máy tính thì bây giờ cả Vista và Ubuntu của em đều không vào internet được.

Bên Vista nó báo "Unidentified Network" và kiểm tra IP có số 169.254... Ngoài ra em để IP động (cả IPv4 và IPv6).

Còn bên Ubuntu, em vừa upgrade lên Ubuntu 9.10 ngày hôm qua đến chiều nay thì cũng không vào được internet. Trước khi rút cable ra thì cả Vista và Ubuntu đều vào net được.

Em sử dụng cable, cable này đem sang laptop khác sử dụng thì chạy bình thường. Anh chị cho em giải pháp nào với. Thanks.
À ra là vậy. Xin lỗi mọi người nhé!
@Mr Bi: Xin phép hỏi cậu này nhé
- Cậu có dùng linux bao giờ chưa?
- Có biết python -h làm cái gì không?

Nếu chưa biết những thứ này thì thôi đi, và cảm ơn cậu!



@mr Bi: Không nhầm! smilie
hi, "python -v" không phải "python -V" smilie
Lúc đầu Python chạy ổn, không gặp lỗi gì. Sau khi mình vọc một số phần xem webcam trên Ubuntu 9.04 thì bây giờ gặp "lỗi" khi gõ lệnh python -v mặc dùng các chức năng khác thì bình thường. Mình đã search nhưng không tìm ra giải pháp nào khắc phục vấn đề này cả nên đành post lên đây nhờ các bạn giúp dùm.

Còn đây là thông điệp của nó:

Code:
username@linux-lappy:~$ python -v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib/python2.6/site.pyc matches /usr/lib/python2.6/site.py
import site # precompiled from /usr/lib/python2.6/site.pyc
# /usr/lib/python2.6/os.pyc matches /usr/lib/python2.6/os.py
import os # precompiled from /usr/lib/python2.6/os.pyc
import errno # builtin
import posix # builtin
# /usr/lib/python2.6/posixpath.pyc matches /usr/lib/python2.6/posixpath.p
import posixpath # precompiled from /usr/lib/python2.6/posixpath.pyc
# /usr/lib/python2.6/stat.pyc matches /usr/lib/python2.6/stat.py
import stat # precompiled from /usr/lib/python2.6/stat.pyc
# /usr/lib/python2.6/genericpath.pyc matches /usr/lib/python2.6/genericpath.py
import genericpath # precompiled from /usr/lib/python2.6/genericpath.pyc
# /usr/lib/python2.6/warnings.pyc matches /usr/lib/python2.6/warnings.py
import warnings # precompiled from /usr/lib/python2.6/warnings.pyc
# /usr/lib/python2.6/linecache.pyc matches /usr/lib/python2.6/linecache.py
import linecache # precompiled from /usr/lib/python2.6/linecache.pyc
# /usr/lib/python2.6/types.pyc matches /usr/lib/python2.6/types.py
import types # precompiled from /usr/lib/python2.6/types.pyc
# /usr/lib/python2.6/UserDict.pyc matches /usr/lib/python2.6/UserDict.py
import UserDict # precompiled from /usr/lib/python2.6/UserDict.pyc
# /usr/lib/python2.6/_abcoll.pyc matches /usr/lib/python2.6/_abcoll.py
import _abcoll # precompiled from /usr/lib/python2.6/_abcoll.pyc
# /usr/lib/python2.6/abc.pyc matches /usr/lib/python2.6/abc.py
import abc # precompiled from /usr/lib/python2.6/abc.pyc
# /usr/lib/python2.6/copy_reg.pyc matches /usr/lib/python2.6/copy_reg.py
import copy_reg # precompiled from /usr/lib/python2.6/copy_reg.pyc
# /usr/lib/python2.6/sitecustomize.pyc matches /usr/lib/python2.6/sitecustomize.py
import sitecustomize # precompiled from /usr/lib/python2.6/sitecustomize.pyc
# /usr/lib/python2.6/dist-packages/apport_python_hook.pyc matches /usr/lib/python2.6/dist-packages/apport_python_hook.py
import apport_python_hook # precompiled from /usr/lib/python2.6/dist-packages/apport_python_hook.pyc
import encodings # directory /usr/lib/python2.6/encodings
# /usr/lib/python2.6/encodings/__init__.pyc matches /usr/lib/python2.6/encodings/__init__.py
import encodings # precompiled from /usr/lib/python2.6/encodings/__init__.pyc
# /usr/lib/python2.6/codecs.pyc matches /usr/lib/python2.6/codecs.py
import codecs # precompiled from /usr/lib/python2.6/codecs.pyc
import _codecs # builtin
# /usr/lib/python2.6/encodings/aliases.pyc matches /usr/lib/python2.6/encodings/aliases.py
import encodings.aliases # precompiled from /usr/lib/python2.6/encodings/aliases.pyc
# /usr/lib/python2.6/encodings/utf_8.pyc matches /usr/lib/python2.6/encodings/utf_8.py
import encodings.utf_8 # precompiled from /usr/lib/python2.6/encodings/utf_8.pyc
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
dlopen("/usr/lib/python2.6/lib-dynload/readline.so", 2);
import readline # dynamically loaded from /usr/lib/python2.6/lib-dynload/readline.so
>>>
- Mình dùng Apache và cấu hình httpd.conf như sau :
Code:
LoadModule rewrite_module modules/mod_rewrite.so

- Trong hình httpd.conf ko có dòng ClearModuleList.
- Đã nhiều lần khởi động lại apache nhưng ko hiểu vì sao mod_rewrite ko hoạt động. Vào link http://root/webapp/home/ thì nó báo là not found.
- Mình đã đọc một số tài liệu trên mạng về cái này nhưng vẫn ko làm được. Xin mọi người giúp đỡ smilie
Thank mọi người đã góp ý, nhưng có lẽ do thuật toán của mình rối quá nên ... làm mình rối theo rồi.
===========
Chẳng qua mình viết script phân trang bằng php,
Code:
<?php
$menuid=$_GET['menu'];
$page=$_GET['page'];
if(isset($page)){
$start=$items_per_page*($page-1);
$end=$start+$items_per_page;
$st="select * from $tbl_music where id >='".$start."' and id <='".$end."' order by id";
}else{
$st="select * from $tbl_music";
}
$menu_music=$db->query($st);
$totalrows=$db->numrows($db->query("select * from $tbl_music order by id"));
$pages=ceil($totalrows/$items_per_page);
echo "<br><b>Trang :</b> <span class='page' width='8' height='5'><a href='".$_SERVER['PHP_SELF']."?menu=$menuid&".SID."' class='page'>All</a></span>";
for($i=1;$i<=$pages;$i++)
{
echo "<span class='page' width='8' height='5'><a href='".$_SERVER['REQUEST_URI']."&page=".$i."' class='page'>".$i."</a></span>";
}
while($menu_music_result=$db->fetch_array($menu_music)){
// su ly
}
?>

Đoạn code này hoạt động bình thường nếu như id liên tục (1,2,3,4.... mà ko phải là 1,3,4...) còn nếu ko thì chạy sai.
Vấn đề là mình ko dùng câu query với mệnh đề where, ở đây mình muốn kết quả trả về là 1 tập hợp các rows. Đề mình diễn tả kỹ hơn smilie
Mình có table news gồm id,newsname, table này có 15 row, select * from news để lấy hết tấc cả.
Sau đó list hết kết quả trả về đồng thời mình muốn xuất ra cả vị trí của dòng hiện tại là dòng bao nhiêu trong table news.
Không biết có cách nào xác định dòng cuối cùng trong 1 câu query select ko nhỉ?
vd của mình thế này :
Giả sử trong table news có 15 rows, table này có column id là index, khi mình query : select * from news. Liệu có cách nào dùng php, mysql để mình biết được giá trị của cột id là bao nhiêu không ?
Thật khó để mà tìm ra 1 cuốn sách viết về Swishmax, ở VN thì hiếm có nhà sách nào có cuốn sách nào viết về Swishmax cả, có cũng viết quá là sơ sài. Nước ngoài thì chỉ có bán chứ ko tìm thấy 1 link nào free cả smilie
Không biết anh em ở đây có ai có tài liệu về nó không? Mình rất thích Swishmax (Quá thích nên hiện tại ko có ý định dùng Flash 8), nếu có hãy share mình với nhé.
Nó chẳng qua là 1 cái plugin thôi !
Trước giờ ko thấy có 1 hướng dẫn nào hack domain cả đâu bạn ơi.
Cũng liên quan đến vấn đề "server hva" smilie em muốn hỏi làm thế nào mà scan ( = nmap) ko thấy phiên bản của các dịch vụ mà server dùng?
Xem lại có chỗ nào cho upload file không.
Dùng Kapersky scan thử xem.

$link = strtolower($_GET['link']);
$link = explode(".", $link);

if ( ( preg_match("/(php|htaccess|php3|asp|jsp|pl|cgi|aspx)/"), $link[count($link)-2] ) )
{
print "Link không hợp lệ.";
exit;
}
 

Dù có sữa lại code thề này thì người ta vẫn có cách tạo ra 1 con r57 để sài đó smilie
Ở nhà sách Nguyễn Văn Cừ có cuốn "Lập trình trong linux" rất hay, có lập trình C, perl, hợp ngữ, cả pascal trên linux luôn smilie
Ai có ebook này thì share mình với, khoái linux quá smilie
Trong các exploit em thường thấy cái gọi là "RETADD" không biết đó là cái gì? Và dùng để làm gì?
Một cái thường thấy nữa là shellcode :

shellcode +="\x66\x81\xca\xff\x0f\x42\x52\x6a\x02\x58\xcd\x2e\x3c\x05\x5a\x74\xef\xb8\x54\x30\x30\x57\x8b\xfa\xaf\x75\xea\xaf\x75\xe7\xff\xe7"
 

Không biết shellcode là cái gì ạ? Và nó dùng để làm gì?
Mình có 1 server dùng plesk, sau khi check server thì thấy server bị lỗi FTP từ đó attacker có thể get root.
Mình muốn hỏi xem làm sao để close port 21 lại nhỉ ?
Thank Siêu Trộm nhé smilie
smilie Chắc tại em cứng đầu smilie
Em có cái thuật toán là thế này : Request đến server bằng 1 link đến 1 file bât kì rồi sau đó nhận lại http status, nếu là 200 thì echo ra Ok, nếu là 404 thì echo "File not found". Và được viết bằng PHP thôi- Only php.
Thanks anh Comale rất nhiều.

nếu em là client thì em hoàn toàn không có khả năng can thiệp những gì server trả lời.
 

Vậy thì không biết các trình duyệt web làm viêc thế nào?
Trong ajax em có thấy:

function handleResponse() {
try {
if((http.readyState == 4)&&(http.status == 200)){
document.getElementById("loading").style.display = "none";
response = http.responseText;
if (current_url.indexOf('Play') != -1 || current_url.indexOf('Gift') != -1) {
field.style.marginBottom = "10";
document.getElementById("show_hide").style.display = "block";
}
field.innerHTML = response;
field.style.display = "";
}
}
catch(e){}
finally{}
}

 

Mình có thể nhận HTTP Status để tùy biến làm việc gì đó mà ? smilie

HoS wrote:
Ý em là trình duyệt nhận HTTP status mà server gởi lại cho client sau khi client request vì em đang là client mà smilie 

Em tìm thấy

HttpMessage::getResponseStatus — Get response status
 

Nhưng nó nói ít quá, em chưa biết dùng :">
Ý em là trình duyệt nhận HTTP status mà server gởi lại cho client sau khi client request vì em đang là client mà smilie

Request được client gởi.
Response được server gởi.

HTTP status do server gởi thì làm sao server lại nhận status?
 

Anh comale hiểu sai ý em rồi, ý em là nhận lại HTTP Status mà server trả lời cho client đó.

Bạn ơi, những hàm send request thông thường đều có phần nhận response bao gồm cả header, http status chỉ là 1 field trong header đó, sao lại cần phải C hay Perl nhỉ?
 

Nếu bạn giúp mình 1 ví dụ( thì tốt quá.
Send request trong PHP thì dể tìm rồi còn nhận lại "HTTP Status" thì chưa tìm được function nào ưng ý.
Cái này chắc phải dùng C hay Perl quá smilie
Mới tìm thấy hàm này :

<?php
$info = apache_lookup_uri('index.php?var=value');
print_r($info);

if (file_exists($info->filename)) {
echo 'file exists!';
}
?>

The above example will output something similar to:

stdClass Object
(
[status] => 200
[the_request] => GET /dir/file.php HTTP/1.1
[method] => GET
[mtime] => 0
[clength] => 0
[chunked] => 0
[content_type] => application/x-httpd-php
[no_cache] => 0
[no_local_copy] => 1
[unparsed_uri] => /dir/index.php?var=value
[uri] => /dir/index.php
[filename] => /home/htdocs/dir/index.php
[args] => var=value
[allowed] => 0
[sent_bodyct] => 0
[bytes_sent] => 0
[request_time] => 1074282764
)
file exists!

 

Hùm hàm này cũng được nè smilie

get_headers() : Fetches all the headers sent by the server in response to a HTTP request
 
- Trong php không biết có function nào có thể nhận trả lời từ server khi mà mình send 1 request tới server không ?. Như trong ajax thì mình có thể biết được server trả về các giá trị như 200 (OK)...
VD: Bình thường mình gõ : http://taolao.com/taolao.php, nếu file này không tồn tại trên server thì mình sẽ nhận được một thông điệp là "File not found" hay "Forbiden". Mình đã tìm mà chưa thấy hàm nào như thế cả. smilie
 
Go to Page:  Page 2 Last Page

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|