- Автор темы
- #1
от что кажет снифеер
вот что делаю я
но в ответ тишина???
PHP:
POST /wp/wp-admin/themes.php?page=functions.php&saved=true HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2) Gecko/20100115 Firefox/3.6 WebMoney Advisor
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://localhost/wp/wp-admin/themes.php?page=functions.php&saved=true
Cookie: wordpress_1233097993469c07c80a9cb529880b71=admin%7C1301068004%7C3316d59ab2219d1673c5c0d37ba7fe92; wp-settings-1=m11%3Dc%26m6%3Do; wp-settings-time-1=1300822882; rated_1997=5; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_1233097993469c07c80a9cb529880b71=admin%7C1301068004%7Cc1b40f61dff9bba0345b5b0ae06bdada; wp-settings-1=m11%3Dc; wp-settings-time-1=1299937139
Content-Type: multipart/form-data; boundary=---------------------------19692764012087
Content-Length: 9079
-----------------------------19692764012087
Content-Disposition: form-data; name="action"
save
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_alt_stylesheet"
1-default.css
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_favicon"
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_logo_url"
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_logo_url_image"; filename=""
Content-Type: application/octet-stream
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_feedburner_url"
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_feedburner_id"
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_image_x_cut"
center
-----------------------------19692764012087
Content-Disposition: form-data; name="action"
save
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_tweet_button"
true
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_facebook_button"
true
-----------------------------19692764012087
Content-Disposition: form-data; name="action"
save
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_videocategory[]"
112
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_videocategory[]"
115
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_breadcrumbs"
true
-----------------------------19692764012087
Content-Disposition: form-data; name="action"
save
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_scripts_header"
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_google_analytics"
-----------------------------19692764012087
Content-Disposition: form-data; name="action"
save
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_meta_description"
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_meta_keywords"
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_meta_author"
-----------------------------19692764012087
Content-Disposition: form-data; name="action"
save
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_home_name"
Home
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_search_name"
Search
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_search_nothing_found"
Nothing found, please search again.
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_general_tags_name"
Tags
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_browsing_category"
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_browsing_tag"
Browsing Tag
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_browsing_author"
Browsing Posts of Author
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_browsing_search"
Browsing Posts filed under Search Term
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_browsing_day"
Browsing Day
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_browsing_month"
Browsing Month
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_browsing_year"
Browsing Year
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_404error_name"
Error 404 | Nothing found!
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_404solution_name"
Sorry, but you are looking for something that is not here.
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_password_protected_name"
This post is password protected. Enter the password to view comments.
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_responsesa_name"
No Comments
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_responsesb_name"
One Comment
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_responsesc_name"
% Comments
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_trackbacks_name"
Trackbacks For This Post
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_moderation_name"
Your comment is awaiting moderation.
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_conversation_name"
Be the first to start a conversation
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_closed_name"
Comments are closed.
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_off_name"
Comments are off for this post
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_reply_name"
Post Your Comments
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_mustbe_name"
You must be
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_loggedin_name"
logged in
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_postcomment_name"
to post a comment.
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_logout_name"
Logout
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_name_name"
Name
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_mail_name"
Mail
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_website_name"
Website
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_addcomment_name"
Add Comment
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_justreply_name"
Reply
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_edit_name"
Edit
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_delete_name"
Delete
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_comment_spam_name"
Spam
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_pagination_first_name"
First
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_pagination_last_name"
Last
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_relative_posted"
Posted
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_relative_ago"
ago
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_relative_s"
s
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_relative_year"
year
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_relative_month"
month
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_relative_week"
week
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_relative_day"
day
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_relative_hour"
hour
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_relative_minute"
minute
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_relative_second"
second
-----------------------------19692764012087
Content-Disposition: form-data; name="ptthemes_relative_moments"
moments
-----------------------------19692764012087
Content-Disposition: form-data; name="save"
Save changes
-----------------------------19692764012087
Content-Disposition: form-data; name="action"
save
-----------------------------19692764012087--
вот что делаю я
PHP:
$user_cookie_file = $_SERVER['DOCUMENT_ROOT'].'http://localhost/test/4/cookie1.txt'; //Полный путь до файла, где будем хранить куки
// инициализация curl
$ch = curl_init ();
// адрес страницы куда посылать запрос
curl_setopt ($ch, CURLOPT_URL , "http://localhost/wp/wp-login.php");
// каким браузером будем прикидываться
curl_setopt ($ch, CURLOPT_USERAGENT , "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.7.12) Gecko/20050919 Firefox/1.0.7");
// Указываем что нужно вывести загруженную страницу в переменную или (0)-вывести на экран
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , 1 );
// Переходить по редиректам или (0)
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
// Подставляем куки
curl_setopt ($ch, CURLOPT_COOKIEFILE, $user_cookie_file); //Куки раз
curl_setopt ($ch, CURLOPT_COOKIEJAR, $user_cookie_file); //Куки два
// елси проверят с какой страницы пришел
curl_setopt ($ch, CURLOPT_REFERER, "http://mail.ru/");
// не возвращает заголовки
curl_setopt ($ch, CURLOPT_HEADER, 0);
// обрабатывает все кодировки
curl_setopt ($ch, CURLOPT_ENCODING, "");
// Включить передачу POST-запроса
curl_setopt ($ch, CURLOPT_POST, 0);
// Отсылаем пост запрос
curl_setopt ($ch, CURLOPT_POSTFIELDS, "log=admin&pwd=pass&wp-submit=Log+In");
// скачиваем страницу в переменную
$parsing = curl_exec($ch);
//$user_cookie_file = $_SERVER['DOCUMENT_ROOT'].'http://localhost/test/4/cookie.txt'; //Полный путь до файла, где будем хранить куки
// инициализация curl
//$ch = curl_init ();
$postdata = array(
'action'=>'save',
'ptthemes_alt_stylesheet'=>'1-default.css',
'ptthemes_image_x_cut'=>'center',
'action'=>'save',
'ptthemes_tweet_button'=>'true',
'ptthemes_facebook_button'=>'true',
'action'=>'save',
'ptthemes_videocategory[]'=>'112',
'ptthemes_blogcategory[]'=>'3',
'action'=>'save',
'ptthemes_breadcrumbs'=>'true',
'action'=>'save',
'action'=>'save',
'action'=>'save',
'action'=>'save',
'ptthemes_home_name'=>'Home',
'ptthemes_search_name'=>'Search',
'ptthemes_search_nothing_found'=>'Nothing found, please search again.',
'ptthemes_general_tags_name'=>'Tags',
'ptthemes_browsing_tag'=>'Browsing Tag',
'ptthemes_browsing_author'=>'Browsing Posts of Author',
'ptthemes_browsing_search'=>'Browsing Posts filed under Search Term',
'ptthemes_browsing_day'=>'Browsing Day',
'ptthemes_browsing_month'=>'Browsing Month',
'ptthemes_browsing_year'=>'Browsing Year',
'ptthemes_404error_name'=>'Error 404 | Nothing found!',
'ptthemes_404solution_name'=>'Sorry, but you are looking for something that is not here.',
'ptthemes_password_protected_name'=>'This post is password protected. Enter the password to view comments.',
'ptthemes_comment_responsesa_name'=>'No Comments',
'ptthemes_comment_responsesb_name'=>'One Comment',
'ptthemes_comment_responsesc_name'=>'% Comments',
'ptthemes_comment_trackbacks_name'=>'Trackbacks For This Post',
'ptthemes_comment_moderation_name'=>'Your comment is awaiting moderation.',
'ptthemes_comment_conversation_name'=>'Be the first to start a conversation',
'ptthemes_comment_closed_name'=>'Comments are closed.',
'ptthemes_comment_off_name'=>'Comments are off for this post',
'ptthemes_comment_reply_name'=>'Leave a Reply',
'ptthemes_comment_mustbe_name'=>'You must be',
'ptthemes_comment_loggedin_name'=>'logged in',
'ptthemes_comment_postcomment_name'=>'to post a comment.',
'ptthemes_comment_logout_name'=>'Logout',
'ptthemes_comment_name_name'=>'Name',
'ptthemes_comment_mail_name'=>'Mail',
'ptthemes_comment_website_name'=>'Website',
'ptthemes_comment_addcomment_name'=>'Add Comment',
'ptthemes_comment_justreply_name'=>'Reply',
'ptthemes_comment_edit_name'=>'Edit',
'ptthemes_comment_delete_name'=>'Delete',
'ptthemes_comment_spam_name'=>'Spam',
'ptthemes_pagination_first_name'=>'First',
'ptthemes_pagination_last_name'=>'Last',
'ptthemes_relative_posted'=>'Posted',
'ptthemes_relative_ago'=>'ago',
'ptthemes_relative_s'=>'s',
'ptthemes_relative_year'=>'year',
'ptthemes_relative_month'=>'month',
'ptthemes_relative_week'=>'week',
'ptthemes_relative_day'=>'day',
'ptthemes_relative_hour'=>'hour',
'ptthemes_relative_minute'=>'minute',
'ptthemes_relative_second'=>'second',
'ptthemes_relative_moments'=>'moments',
'save'=>'Save changes',
'action'=>'save'
);
// адрес страницы куда посылать запрос
curl_setopt ($ch, CURLOPT_URL , "http://localhost/wp/wp-admin/themes.php?page=functions.php&saved=true");
// каким браузером будем прикидываться
curl_setopt ($ch, CURLOPT_USERAGENT , "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.7.12) Gecko/20050919 Firefox/1.0.7");
// Указываем что нужно вывести загруженную страницу в переменную или (0)-вывести на экран
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , 1 );
// Переходить по редиректам или (0)
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
// Подставляем куки
curl_setopt ($ch, CURLOPT_COOKIEFILE, $user_cookie_file); //Куки раз
curl_setopt ($ch, CURLOPT_COOKIEJAR, $user_cookie_file); //Куки два
// елси проверят с какой страницы пришел
curl_setopt ($ch, CURLOPT_REFERER, "http://mail.ru/");
// не возвращает заголовки
curl_setopt ($ch, CURLOPT_HEADER, 0);
// обрабатывает все кодировки
curl_setopt ($ch, CURLOPT_ENCODING, "");
// Включить передачу POST-запроса
curl_setopt ($ch, CURLOPT_POST, 1);
// Отсылаем пост запрос
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
// скачиваем страницу в переменную
echo $parsing = curl_exec($ch);