找回密码
 开放注册

QQ登录

只需一步,快速开始

微信登录

微信扫码,快速开始

搜索
查看: 883|回复: 0

各种webshell密码加密与解密相关代码

[复制链接]
已绑定手机

637

主题

-13

回帖

2240

牛毛

二级牛人

积分
2240
QQ
发表于 2012-3-14 14:46:58 | 显示全部楼层 |阅读模式 来自 黑龙江省哈尔滨市
网页木马大部分密码都是明文得,不过也有用md5得,也好,可以很容易破解,最主要是不标准网马加密,密码一般加密后只有加密代码,没有解密,我收集了一些(不断补充).

function decrypt(dcode)
dim texts
dim i
for i=1 to len(dcode)
texts=texts & chr(asc(mid(dcode,i,2))-i)
next
decrypt=texts
end function


function encrypt(ecode)
Dim texts
dim i
for i=1 to len(ecode)
texts=texts & chr(asc(mid(ecode,i,2))+i)
next
encrypt = texts
end function

=============在某cms系统管理员密码中使用,如"2375;7?" 解密后1141618



海洋顶端:

加密,保存成vbs

========================

Dim theStr

theStr = InputBox("请输入要加密的字串")

If theStr <> "" Then

Call InputBox("请复制已经加密好的字串",,Encode(theStr))

End If

Function Encode(strPass)

Dim i, theStr, strTmp

' for循环得到密码各个字符的ascii值,每位值都在0~9

For i = 1 To Len(strPass)

strTmp = Asc(Mid(strPass, i, 1))

theStr = theStr & Abs(strTmp)

Next

strPass = theStr

theStr = ""

' 如果前面得到的值位数大于16就进入JoinCutStr函数处理,使之小于16

Do While Len(strPass) > 16

strPass = JoinCutStr(strPass)

Loop

' 这个for循环处理每个字符,把7、8、9转为C、D、E,其余不变

For i = 1 To Len(strPass)

strTmp = CInt(Mid(strPass, i, 1))

strTmp = IIf(strTmp > 6, Chr(strTmp + 60), strTmp)

theStr = theStr & strTmp

Next

Encode = theStr

End Function

' JoinCutStr函数把奇数位和偶数位的ascii相加整除2得到新字符,取值在0~9

Function JoinCutStr(str)

Dim i, theStr

For i = 1 To Len(str)

If Len(str) - i = 0 Then Exit For

theStr = theStr & Chr(CInt((Asc(Mid(str, i, 1)) + Asc(Mid(str, i + 1, 1))) / 2))

i = i + 1

Next

JoinCutStr = theStr

End Function

' VB的(a>b)?a:b

Function IIf(var, val1, val2)

If var = True Then

IIf = val1

Else

IIf = val2

End If

End Function


解密(保存为vbs):

==================

theStr = InputBox("输入加密后的字串")

If theStr <> "" Then

Call InputBox("请复制已经解密的字串",,UnEncode(theStr))

End If

Function UnEncode(str)

For i = 1 To Len(str)

theStr1 = Mid(str, i, 1)

If theStr1 = "C" Then

theStr1 = "7"

ElseIf theStr1 = "D" Then

theStr1 = "8"

ElseIf theStr1 = "E" Then

theStr1 = "9"

End If

StrPass2 = StrPass2 & theStr1

Next

StrPass3 = GetChr(StrPass2)

UnEncode = StrPass3

End Function

Function GetChr(str)

For i = 1 To Len(str)

ASCStr = Mid(str, i, 1)
MyStr = MyStr & ASCStr

If MyStr > 32 and MyStr < 127 Then

StrResult = StrResult & Chr(MyStr)

MyStr = ""

Else

If i = Len(str) Then

GetChr = "小虾无能,不能破解"

exit function

End If

End If

Next

GetChr = StrResult

End Function
您需要登录后才可以回帖 登录 | 开放注册

本版积分规则

帮助|Archiver|小黑屋|通信管理局专项备案号:[2008]238号|NB5社区 ( 皖ICP备08004151号;皖公网安备34010402700514号 )

GMT+8, 2025-4-25 14:50 , Processed in 0.582454 second(s), 34 queries .

Powered by Discuz! X3.5

快速回复 返回顶部 返回列表