Paul C's Blog

To be funny,to grow up!

0%

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#通过模拟键盘的方式获取报告
#参考https://blog.csdn.net/yan_star/article/details/113667094

import os
import pyautogui as pag
import pyperclip
import win32clipboard as w
import win32con#下载pywin32包
import time


address_bar=(1322,107) #地址栏坐标
test_result=(142,365) #预测结果所在坐标


api_addr="https://www.virustotal.com/gui/file/"

samples_addr="E:\Linux_sh\malware\Linux-Malware-Samples"#样本需要提前计算sha256值
report_addr="E:/Linux_sh/report_"+samples_addr+".txt"
test_str="00ae07c9fe63b080181b8a6d59c6b3b6f9913938858829e5a42ab90fb72edf7a"
url=api_addr+test_str
flag=1#flag==1为恶意


def get_text():
w.OpenClipboard()
d = w.GetClipboardData(win32con.CF_TEXT)
w.CloseClipboard()
return d.decode('utf-8')

def examine(file):
#输入网址
url=api_addr+file
pag.click(address_bar[0],address_bar[1],1)
pag.hotkey('alt','d')
pyperclip.copy(url)
#pyperclip.paste()
pag.hotkey('ctrl','v')
pag.keyDown('enter')
pag.keyUp('enter')
time.sleep(2)
#获取检测结果(142,365)
pag.click(test_result[0],test_result[1],2)
pag.hotkey('ctrl','c')
result=get_text()
if result=='0':
flag=0
else:
flag=1
print('%s:%d\n'%(test_str,flag))



if __name__ == "__main__":
path=samples_addr
samples=os.listdir(samples_addr)
for file in samples:
examine(file)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
-- coding: cp936 --

coging:UTF-8

二进制转16进制

ch=['0','1','2','3','4','5','6','7','8',
'9','A','B','C','D','E','F']
x=int(input("请输入一个二进制数="))
y=0
k=0
while True:
k+=1
i=x % 10
if i1:
y=y+2**(k-1)
x=x//10
if x0:
break
z=''
while True:
k=y % 16
z=ch[k]+z
y=y // 16
if y==0:
break
print(z)

1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env python
#读取二进制文件,转为16进制输出
#encoding: utf-8
import binascii
#fh = open(r'E:\test.png', 'rb')
#a = fh.read()
#print 'raw: ',`a`,type(a)
a='011001100110110001100001011001110111101101100011011001010011001101100101001101010011000000110010011000110010110100110100001110000110001100111001001011010011010001100100001101010011000000101101001110010011100100111001001100000010110100110101011000100011100000110001011001000110001000110110011001100110001101100010011001100011000001111101'
hexstr = binascii.b2a_hex(a)
print a
print hexstr #示意结果为4d5a900003000000....

1
2
3
4
5
6
from bubblepy import BubbleBabble

str='xinik-samak-luvag-hutaf-fysil-notok-mepek-vanyh-zipef-hilok-detok-damif-cusol-fezyx'
bb=BubbleBabble()
print(bb.decode(str))

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from zlib import crc32
import random

char='0123456789'

def crc32_f(data):
return hex(crc32(data)&0xffffffff)[2:10]

length=input('length:')
crc32_=raw_input('crc32:').lower()

while True:
text=''
for i in range(length):
text+=char[random.randint(0,len(char)-1)]
if crc32_f(text)==crc32_:
raw_input('find it:'+text)
exit

1
2
ssh -t root@149.28.228.xxx
// 安裝執行檔和 .dat 資料檔

https://www.bokezhu.com/2019/12/28/521.html

1
2
3
4
curl blueinyou.com/photos/server_config.txt
cp -rf server_config.txt /usr/local/etc/v2ray/config.json
vim /usr/local/etc/v2ray/config.json

输入以下信息:

1
2
3
service v2ray status
systemctl enable v2ray
systemctl start v2ray

更新dat和geoip

1
2
// 只更新 .dat 資料檔
# bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-dat-release.sh)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import base64
f=open('input.txt','r')
out=open('base64_decode.txt','w')
f1=f.read()
def b64dec(astr,m):
f2=astr
for i in range(m):
f2=base64.b64decode(f2)
print f2
astr=f2
out.write(astr)


b64dec(f1,2)
f.close()
out.close()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#-*-coding:utf-8-*-


'''
fileName : VigenereDecrypto.py
'''

def VigenereDecrypto (output , key) :
ptLen = len (output)
keyLen = len (key)
quotien = ptLen // keyLen
remainder = ptLen % keyLen

inp = ""

for i in range (0 , quotient) :
for j in range (0 , keyLen) :
c = int((ord(output[i*keyLen+j]) - ord('a') + 26 - (ord(key[j]) - ord('a')) % 26 + ord('a')))
#global input
inp += chr (c)

for i in range (0 , remainder) :
c = int((ord(output[quotient*keyLen + i]) - ord('a') + 26 - (ord(key[i]) - ord('a')) % 26 + ord('a')))
#global input
inp += chr (c)

return inp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import hashlib
#hashlib简单使用
def md5(arg):#这是加密函数,将传进来的函数加密
md5_pwd = hashlib.md5(bytes('abd',encoding='utf-8'))
md5_pwd.update(bytes(arg,encoding='utf-8'))
return md5_pwd.hexdigest()#返回加密的数据
def log(user,pwd):#登陆时候时候的函数,由于md5不能反解,因此登陆的时候用正解
with open('db','r',encoding='utf-8') as f:
for line in f:
u,p=line.strip().split('|')
#strip()是删除首尾的字符串
#split()是将字符串按某一个字符分割,且分割n次。如按‘.’分割n次
if u ==user and p == md5(pwd):#登陆的时候验证用户名以及加密的密码跟之前保存的是否一样
return True
def register(user,pwd):#注册的时候把用户名和加密的密码写进文件,保存起来
with open('db','a',encoding='utf-8') as f:
temp = user+'|'+md5(pwd)
f.write(temp)

i=input('1表示登陆,2表示注册:')
if i=='2':
user = input('用户名:')
pwd =input('密码:')
register(user,pwd)
elif i=='1':
user = user = input('用户名:')
pwd =input('密码:')
r=log(user,pwd)#验证用户名和密码
if r ==True:
print('登陆成功')
else:
print('登陆失败')
else:
print('系统不存在此功能模块')