web网络安全——网站入侵(二)

成功例子分析(主要介绍非技术渗透步骤):

某学院(难度很小的一类学校)
http://XX.XX.XX.XX/
1) 查看网站框架:chrome F12抓包分析:根据抓包Header中会有一部分网站信息,
网站框架:VWebServer/6.0.0 Apache Tomcat/6.0.29 6.0.43(后续查看网页源代码,报错页面显示信息)
2) 查看网页源代码:
注释:CustomerNO:7765626265723230747647545253574203060000
文字采用UTF-8方式进行Base64编码
异常链接:
http://XX.XX.XX.XX:6611/web/web/web/a_index.asp 教务在线登陆 爆出端口号6611
http://XX.XX.XX.XX:9922/yx/orientation/guest/login.action 迎新系统
基本信息页面 http://XX.XX.XX.XX/info/1046/11570.htm 猜测是静态html???
http:

  • 5
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Web Service 安全是指保护 Web Service 不受恶意攻击和非法访问的一系列措施。其中,Basic 验证是最简单的一种身份验证方式,也是最常用的一种。 Basic 验证的原理是在 HTTP 头部中添加一个 Authorization 字段,该字段包含一个经过编码的用户名和密码。在服务端接收到请求后,会验证该用户名和密码是否正确,如果正确,则允许访问 Web Service,否则拒绝访问。 下面是一个使用 Basic 验证的 Web Service 的示例: ```xml <definitions name="HelloWorld" targetNamespace="http://www.example.org/HelloWorld" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/HelloWorld" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <types> <xsd:schema targetNamespace="http://www.example.org/HelloWorld"> <xsd:element name="sayHello" type="xsd:string"/> <xsd:element name="sayHelloResponse" type="xsd:string"/> </xsd:schema> </types> <message name="sayHelloRequest"> <part name="name" type="xsd:string"/> </message> <message name="sayHelloResponse"> <part name="greeting" type="xsd:string"/> </message> <portType name="HelloWorld"> <operation name="sayHello"> <input message="tns:sayHelloRequest"/> <output message="tns:sayHelloResponse"/> </operation> </portType> <binding name="HelloWorldSoapBinding" type="tns:HelloWorld"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="sayHello"> <soap:operation soapAction=""/> <input> <soap:header message="tns:sayHelloRequest" part="Authorization" use="required"/> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding> <service name="HelloWorld"> <port name="HelloWorldPort" binding="tns:HelloWorldSoapBinding"> <soap:address location="http://localhost:8080/HelloWorld"/> </port> </service> </definitions> ``` 在上面的示例中,我们在 `<binding>` 标签中定义了一个 Authorization 头部,它的 use 属性设置为 required,表示该头部是必须的。这个头部包含了一个经过用户名和密码编码的字符串。 在服务端,我们需要在代码中对该 Authorization 头部进行解码,然后验证用户名和密码是否正确。如果正确,则允许访问 Web Service,否则拒绝访问。下面是一个使用 Java 代码实现的 Basic 验证的示例: ```java public class HelloWorldImpl implements HelloWorld { @Override public String sayHello(String name) { String auth = (String) wsContext.getMessageContext().get(MessageContext.HTTP_REQUEST_HEADERS).get("Authorization").get(0); String[] parts = auth.split(" "); byte[] decoded = Base64.getDecoder().decode(parts[1]); String credentials = new String(decoded); String[] credentialParts = credentials.split(":"); String username = credentialParts[0]; String password = credentialParts[1]; if (username.equals("admin") && password.equals("password")) { return "Hello, " + name + "!"; } else { throw new RuntimeException("Unauthorized access"); } } } ``` 在上面的代码中,我们首先从 MessageContext 中获取 Authorization 头部,然后对该头部进行解码。解码后得到的是一个用户名和密码的字符串,我们再对该字符串进行拆分,得到用户名和密码。最后,我们根据用户名和密码的正确性来决定是否允许访问 Web Service。 需要注意的是,Basic 验证并不是一种安全性很高的身份验证方式。因为它使用明文传输用户名和密码,所以容易被窃取。因此,在实际应用中,我们通常会使用更加安全的身份验证方式,比如 Digest 验证或 SSL/TLS 验证。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值