Any thoughts on security
Moderator: Rathinagiri
- AUGE_OHR
- Posts: 2093
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: Any thoughts on security
hi Franco,
you can not change Byte in "Header" of File but you can add something "at End" of File
this might be identify as Attack by Antivirus when "infect" a File by add CODE
---
you can not delete a File which is running.
use a *.BAT File for that CODE which you have post as xBase Syntax
you can not change Byte in "Header" of File but you can add something "at End" of File
this might be identify as Attack by Antivirus when "infect" a File by add CODE
---
you can not delete a File which is running.
use a *.BAT File for that CODE which you have post as xBase Syntax
have fun
Jimmy
Jimmy
Re: Any thoughts on security
Code: Select all
if file('winlog1.ese')
copy file winlog1.ese to winlog1.exe //This works
msgbox('You Must Restart Program After Entering the Following') //This works
Do While .Not. hb_FileDelete('winlog1.ese')
Do events
End Do
execute file('winlog1.exe')
Do While .Not. hb_FileDelete( 'winlog1.exe')
Do events
End Do
cancel
return
endif
Re: Any thoughts on security
Thanks Edward, this completely makes sense.
Jimmy try this it works so we could basically send a program to a client that only works only 1 time by erasing it after use inside another program.
Anyone, give it a try with any hmg program.
Jimmy try this it works so we could basically send a program to a client that only works only 1 time by erasing it after use inside another program.
Code: Select all
#include <hmg.ch>
local msn := '', memvar
memvar := memoread('winlog1.ese') // any hmg .exe program
*msgbox(substr(memvar,79,1))
memowrit('winlog1.ese', substr(memvar,1,78)+substr(memvar,80,len(memvar)-78)) // This takes out the T
copy file winlog1.ese to winlog1.exe // changes extention
execute file('winlog1.exe') //Will not run
*msgbox()
memvar := memoread('winlog1.exe')
memowrit('winlog1.exe',subst(memvar,1,78)+'T'+substr(memvar,79,len(memvar)-78)) // This replaces the T
memowrit('winlog1.ese',subst(memvar,1,78)+'T'+substr(memvar,79,len(memvar)-78))
execute file('winlog1.exe') //Then it works
*msgbox()
RETURN
Last edited by franco on Sun Dec 10, 2023 9:12 am, edited 1 time in total.
All The Best,
Franco
Canada
Franco
Canada
Re: Any thoughts on security
Had to adjust previous post.
Code: Select all
#include <hmg.ch>
local memvar
memvar := memoread('winlog1.ese') // any hmg .exe program
*msgbox(substr(memvar,79,1))
memowrit('winlog1.ese', substr(memvar,1,78)+substr(memvar,80,len(memvar)-78)) // This takes out the T from exe file
copy file winlog1.ese to winlog1.exe
execute file('winlog1.exe') //Will not run
*msgbox()
memvar := memoread('winlog1.exe')
memowrit('winlog1.exe',subst(memvar,1,78)+'T'+substr(memvar,79,len(memvar)-78)) // This replaces the T
memowrit('winlog1.ese',subst(memvar,1,78)+'T'+substr(memvar,79,len(memvar)-78))
execute file('winlog1.exe') //Then it works
*msgbox()
RETURN
All The Best,
Franco
Canada
Franco
Canada
Re: Any thoughts on security
Does anyone know how to stop a program from running from inside another program.
If I execute a program exe2 from inside program exe1 I would like to stop exe1 from running from exe2 so I can modify it or delete it
as EDK subjects above.
If I can do this I have figured a pretty sure way of creating an secure program.
Thanks in advance Franco
If I execute a program exe2 from inside program exe1 I would like to stop exe1 from running from exe2 so I can modify it or delete it
as EDK subjects above.
If I can do this I have figured a pretty sure way of creating an secure program.
Thanks in advance Franco
All The Best,
Franco
Canada
Franco
Canada
Re: Any thoughts on security
Have figured out, before deleting as EDK above.
I run the table making exe program from inside main exe program. After tables are made I can write to program while running.
memowrit('winlog1.exe',"winlog")
I run the table making exe program from inside main exe program. After tables are made I can write to program while running.
memowrit('winlog1.exe',"winlog")
Code: Select all
// from inside main exe program
if file('winlog1.ese') // These files create the tables for main exe program
copy file winlog1.ese to winlog1.exe //This works
msgbox('You Must Restart Program After Entering the Following') //This works
memowrit('winlog1.ese',"winlog1")
Do While .Not. hb_FileDelete('winlog1.ese')
Do events
End Do
execute file('winlog1.exe')
memowrit('winlog1.exe',"winlog1")
Do While .Not. hb_FileDelete( 'winlog1.exe')
Do events
End Do // Now if someone finds the winlog programs they will never work again
// We do not need them the tables are created.
cancel
return
endif
All The Best,
Franco
Canada
Franco
Canada
Re: Any thoughts on security
Hi All,
Still trying to make this better.
If I could close a program from running from another program I would have this figured to perfection.
Open exe1. Run exe2 from inside exe1. close exe1 from inside exe2.
Then I can put the exe1`s new serial number into it with memwrite
Still trying to make this better.
If I could close a program from running from another program I would have this figured to perfection.
Open exe1. Run exe2 from inside exe1. close exe1 from inside exe2.
Then I can put the exe1`s new serial number into it with memwrite
All The Best,
Franco
Canada
Franco
Canada
Re: Any thoughts on security
Check out the process ID based solution:
Re: Any thoughts on security
Thanks EDK, I tried building demos but get HMG_UPPER errors when I try to run exe2 from exe1. Nothing seems to happen when I run exe2 to kill exe 1.
All The Best,
Franco
Canada
Franco
Canada
Re: Any thoughts on security
Which version of HMG are you compiling exe1.prg and exe2.prg?
I tested on versions 3.4.4 and 3.6 and it works for me.
Post what you have in edit boxes exe1 and exe2.
Exe2 will only be able to kill exe1 if exe2 is started from exe1.
I tested on versions 3.4.4 and 3.6 and it works for me.

Post what you have in edit boxes exe1 and exe2.
Exe2 will only be able to kill exe1 if exe2 is started from exe1.