Skip to content

Commit

Permalink
Add shellcode search in peda framework
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanSalwan committed Oct 6, 2012
1 parent 3589646 commit c1a19fe
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
22 changes: 21 additions & 1 deletion lib/shellcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,27 @@ def search(self, keyword):
data_l = res.read().split('\n')
except:
print "Can't connect to shell-storm.org"
return data_l

data_dl = []
for data in data_l:
try:
ScAuthor = data.split("::::")[0]
ScArch = data.split("::::")[1]
ScTitle = data.split("::::")[2]
ScId = data.split("::::")[3]
ScUrl = data.split("::::")[4]
dico = {
'ScAuthor': ScAuthor,
'ScArch': ScArch,
'ScTitle': ScTitle,
'ScId': ScId,
'ScUrl': ScUrl
}
data_dl.append(dico)
except:
pass

return data_dl

def display(self, shellcodeId):
return None
Expand Down
17 changes: 4 additions & 13 deletions peda.py
Original file line number Diff line number Diff line change
Expand Up @@ -5320,8 +5320,7 @@ def skeleton(self, *arg):

def shellcode(self, *arg):
"""
Generate common shellcodes: exec | bindport | connect
Download shellcodes on shell-storm API
Generate or download common shellcodes: exec | bindport | connect
Usage:
MYNAME generate [arch/]platform type [port] [host]
MYNAME search keyword
Expand Down Expand Up @@ -5380,17 +5379,9 @@ def list_shellcode():
msg(text)

elif mode == "search":
res_l = Shellcode().search(keyword)
for data in res_l:
try:
ScAuthor = data.split("::::")[0]
ScArch = data.split("::::")[1]
ScTitle = data.split("::::")[2]
ScId = data.split("::::")[3]
ScUrl = data.split("::::")[4]
print "[%s]\t%s" %(yellow(ScId), ScTitle)
except:
pass
res_dl = Shellcode().search(keyword)
for data_d in res_dl:
print "[%s]\t%s - %s" %(yellow(data_d['ScId']), data_d['ScArch'], data_d['ScTitle'])

elif mode == "display":
Shellcode().display(shellcodeId)
Expand Down

0 comments on commit c1a19fe

Please sign in to comment.