发表文章

[C] 密码身份验证不起作用, 无法将 https 转发到初始页。 Password authentication isn't working, can't forward https to splash page.[nodogsplash]

autocar23 2017-10-9 41

以下是我所做的:

  1. 重置为出厂设置
  2. 运行 opkg 更新
  3. 运行 opkg 安装/tmp/nodogsplash *. ipk
  4. 更改/等/配置/nodogsplash 行4到 ' 选项启用 1 '
  5. 运行/等/初始化 nodogsplash 启动
  6. 重新启动路由器
    之后, 每件事情都很好, 但有几个问题出现了:
  7. 通过编辑 nodogsplash 打开密码身份验证之后, 将 html 表单插入到飞溅中. html 然后运行/等/init. d/nodogsplash 重新加载然后重新启动路由器。
    无论我在身份验证表中键入什么, 然后输入, 我总是得到认证。
  8. 当我未进行身份验证时, 可以通过访问 http 页将其转发到初始页。但是, 如果我单击的是一个 https 链接 (如https://github.com), 则无法将其转发到初始页, 并获得 ERR_CONNECTION_TIMED_OUT。

我使用 openwrt-15.05.1-ar71xx-通用-wndr3800-squashfs-工厂和
nodogsplash_1.0. 0-1_ar71xx. ipk
以下是我的文件:

root@OpenWrt:/# cat /etc/nodogsplash/nodogsplash.conf
PasswordAuthentication 1
UsernameAuthentication 1

Password 123
Username 123
PasswordAttempts 5
root@OpenWrt:/# cat /etc/config/nodogsplash

config nodogsplash
  # Set to 1 to enable nodogsplash
  option enabled 1

  # Use plain configuration file
  #option config '/etc/nodogsplash/nodogsplash.conf'

  # The network the users are connected to
  option network 'lan'
  option gatewayname 'OpenWrt Nodogsplash'
  option maxclients '250'
  option idletimeout '1200'

  # Your router may have several interfaces, and you
  # probably want to keep them private from the network/gatewayinterface.
  # If so, you should block the entire subnets on those interfaces, e.g.:
  list authenticated_users 'block to 192.168.0.0/16'
  list authenticated_users 'block to 10.0.0.0/8'

  # Typical ports you will probably want to open up.
  list authenticated_users 'allow tcp port 22'
  list authenticated_users 'allow tcp port 53'
  list authenticated_users 'allow udp port 53'
  list authenticated_users 'allow tcp port 80'
  list authenticated_users 'allow tcp port 443'

  # For preauthenticated users to resolve IP addresses in their
  # initial request not using the router itself as a DNS server,
  list preauthenticated_users 'allow tcp port 53'
  list preauthenticated_users 'allow udp port 53'

  # Allow ports for SSH/Telnet/DNS/DHCP/HTTP/HTTPS
  list users_to_router 'allow tcp port 22'
  list users_to_router 'allow tcp port 23'
  list users_to_router 'allow tcp port 53'
  list users_to_router 'allow udp port 53'
  list users_to_router 'allow udp port 67'
  list users_to_router 'allow tcp port 80'
  list users_to_router 'allow tcp port 443'

  # See https://github.com/nodogsplash for a full list of available options.
root@OpenWrt:/# cat /etc/nodogsplash/htdocs/splash.html
<html>
<head>
        <title>$gatewayname Entry</title>
        <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
</head>
<body bgcolor="#DDDDDD" text="#000000">
  <form method='GET' action='$authaction'>
  <input type='hidden' name='tok' value='$tok'>
  <input type='hidden' name='redir' value='$redir'>
  username: <input type='text' name='nodoguser' value='' size='12' maxlength='12'>
  <br>
  password: <input type='password' name='nodogpass' value='' size='12' maxlength='10'>
  <br>
  <input type='submit' value='Enter'>
  </form>

<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
        <td align="center"><h2>$gatewayname</h2></td>
</tr>
<tr>
        <td align="center" height="120">
        <a href="$authtarget">
        <img src="$imagesdir/splash.jpg" width="71" height="49" border="0"
                alt="Click to enter" title="Click to enter">
        </a>
        </td>
</tr>
</table>

</body>
</html>

对不起, 英语不好, 希望你能理解。

原文:

Here is what i have done:

  1. reset to factory setting
  2. run opkg update
  3. run opkg install /tmp/nodogsplash*.ipk
  4. change /etc/config/nodogsplash line 4 to 'option enabled 1'
  5. run /etc/init.d/nodogsplash start
  6. reboot the router
    After that, every thing works fine, but several issues comes up:
  7. After turn on password authentication by editing nodogsplash.conf then insert the HTML form into splash.html then run /etc/init.d/nodogsplash reload then reboot the router.
    No matter what i type at the authentication form then enter, i always get authenticated.
  8. When i am unauthenticated, i can be forwarded to the splash page by visiting a http page. but if what i click is a https link like https://github.com, i am unable to be forwarded to the splash page, and get an ERR_CONNECTION_TIMED_OUT.

I am using openwrt-15.05.1-ar71xx-generic-wndr3800-squashfs-factory and
nodogsplash_1.0.0-1_ar71xx.ipk.
Here is my conf file:

root@OpenWrt:/# cat /etc/nodogsplash/nodogsplash.conf
PasswordAuthentication 1
UsernameAuthentication 1

Password 123
Username 123
PasswordAttempts 5
root@OpenWrt:/# cat /etc/config/nodogsplash

config nodogsplash
  # Set to 1 to enable nodogsplash
  option enabled 1

  # Use plain configuration file
  #option config '/etc/nodogsplash/nodogsplash.conf'

  # The network the users are connected to
  option network 'lan'
  option gatewayname 'OpenWrt Nodogsplash'
  option maxclients '250'
  option idletimeout '1200'

  # Your router may have several interfaces, and you
  # probably want to keep them private from the network/gatewayinterface.
  # If so, you should block the entire subnets on those interfaces, e.g.:
  list authenticated_users 'block to 192.168.0.0/16'
  list authenticated_users 'block to 10.0.0.0/8'

  # Typical ports you will probably want to open up.
  list authenticated_users 'allow tcp port 22'
  list authenticated_users 'allow tcp port 53'
  list authenticated_users 'allow udp port 53'
  list authenticated_users 'allow tcp port 80'
  list authenticated_users 'allow tcp port 443'

  # For preauthenticated users to resolve IP addresses in their
  # initial request not using the router itself as a DNS server,
  list preauthenticated_users 'allow tcp port 53'
  list preauthenticated_users 'allow udp port 53'

  # Allow ports for SSH/Telnet/DNS/DHCP/HTTP/HTTPS
  list users_to_router 'allow tcp port 22'
  list users_to_router 'allow tcp port 23'
  list users_to_router 'allow tcp port 53'
  list users_to_router 'allow udp port 53'
  list users_to_router 'allow udp port 67'
  list users_to_router 'allow tcp port 80'
  list users_to_router 'allow tcp port 443'

  # See https://github.com/nodogsplash for a full list of available options.
root@OpenWrt:/# cat /etc/nodogsplash/htdocs/splash.html
<html>
<head>
        <title>$gatewayname Entry</title>
        <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
</head>
<body bgcolor="#DDDDDD" text="#000000">
  <form method='GET' action='$authaction'>
  <input type='hidden' name='tok' value='$tok'>
  <input type='hidden' name='redir' value='$redir'>
  username: <input type='text' name='nodoguser' value='' size='12' maxlength='12'>
  <br>
  password: <input type='password' name='nodogpass' value='' size='12' maxlength='10'>
  <br>
  <input type='submit' value='Enter'>
  </form>

<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr>
        <td align="center"><h2>$gatewayname</h2></td>
</tr>
<tr>
        <td align="center" height="120">
        <a href="$authtarget">
        <img src="$imagesdir/splash.jpg" width="71" height="49" border="0"
                alt="Click to enter" title="Click to enter">
        </a>
        </td>
</tr>
</table>

</body>
</html>

sorry for the poor english, hope you understand.

相关推荐
最新评论 (0)
返回
发表文章
autocar23
文章数
1
评论数
0
注册排名
60910