Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use the curl command line to simulate login to WordPress

2025-06-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

WordPress default login page: http://192.168.0.120/wordpress/wp-login.php

1. Chrome browser F12, enter an incorrect password and click to log in:

Take out "log=root&pwd=root@123&wp-submit=%E7%99%BB%E5%BD%95&redirect_to=http%3A%2F%2F192.168.0.120%2Fwordpress%2Fwp-admin%2F&testcookie=1" and replace it with the correct password

2. Obtain cookie:

# curl-b cookies-c cookies "http://192.168.0.120/wordpress/wp-login.php" > index.html

Note: log in to the blog using the saved cookies file

3. Simulated login home page:

# curl-L-b cookies-c cookies-d "log=root&pwd=root@123&wp-submit=%E7%99%BB%E5%BD%95&redirect_to=http%3A%2F%2F192.168.0.120%2Fwordpress%2Fwp-admin%2F&testcookie=1"http://192.168.0.120/wordpress/wp-login.php" > wordpress.html

# cp wordpress.html / var/www/html

The browser accesses http://192.168.0.120/wordpress.html and is already logged in.

Then click "articles" on the left:

Get the link to "write articles": http://192.168.0.120/wordpress/wp-admin/edit.php

4. Log in to the "write articles" page by simulating:

Since the write article function does not need to submit any parameters, use the following command directly:

# curl-L-b cookies-c cookies "http://192.168.0.120/wordpress/wp-admin/edit.php" > article.html

# cp article.html / var/www/html

The browser accesses http://192.168.0.120/article.html and is already on the "write articles" page

4. Description:

(1) difference between cookie and session:

Both cookie and session are session technologies. Cookie runs on the client browser, while session runs on the server side of the website.

There is a limit on the size of the @ cookie, and there is also a limit on the number of cookie stored in the browser. There is no limit on the size of the session, which is related to the memory of the server.

There is a security risk in the @ cookie. There is a security risk by intercepting or finding the local cookie file.

* session is saved on the server and will exist for a period of time before it disappears. If there is too much session, it will increase the pressure on the server.

(2) Common options for curl command line:

-b: reads the cookie from the specified string or file

-c: writes cookie to the specified file

Z.-L: follow the jump

^-I: only document information is displayed

A: the user agent to send to the server side

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report