• Welcome, Guest. Please login.
 
March 28, 2020, 09:11:15 am

News:

Welcome to the SQLitening support forums!


Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - cj

1
Fim,

Note: TRIM$ causes problems with lines requiring leading or trailing spaces.
I put it into a macro only for convenience in an above example.
MACRO btt(parm) = slBuildBindDat(TRIM$(parm),"T") 'bind trim text (not good loading files)
MACRO bt(parm)=slBuildBindDat(parm,"T")'bind text

Binding makes loading or saving files or strings into columns work "as is" without the $SQ issues.
Binding strings without "T" should only be used with binary/blob data so it compares correctly.

#INCLUDE "sqlitening.inc" 'fim00.bas
FUNCTION PBMAIN () AS LONG
 LOCAL COL AS LONG, sresult, search AS STRING
 slOpen
 slexe "create table t1(C1 text collate nocase,C2 text collate nocase)"
 slexeBind "insert into t1 values(?,?)",slBuildBindDat("Heidi","T") + slBuildBindDat("Klum","T")
 slexeBind "insert into t1 values(?,?)",slBuildBindDat("Heidi","T") + slBuildBindDat("Mouse","T")
 slexeBind "Insert into t1 values(?,?)",bt("Heidi") + bt("Macro used") 'for convenience
 search = "HEIDi"
 slSelBind "Select c1,c2 From t1 Where c1 = ? Order by c2", slBuildBindDat(search,"T")
 DO WHILE slGetRow:FOR COL=1 TO slGetColumnCount:sresult+=USING$("&&",slf(COL),$TAB):NEXT:sresult+=$CR:LOOP:?sresult
END FUNCTION
2
Requires Windows 10 Pro

Only receivers computer names and or IP addresses are used.
"mycomputer" could be any computer name on the network.
Sending to 127.0.0.1 sends to yourself.
Could not get to BEEP and moved to General Board.

Windows MSG.EXE command doesn't send slGetError because of a leading "-"!
Added code to handle TRIM$ of message starting with a "-" or "/" or a blank message.
Added sending result of slPut as a NetSendMessage example.

NetSendMessage computers$, sMsg$, TimeOnScreen&

https://sqlitening.planetsquires.com/index.php?topic=9753.0
3
[source]
#INCLUDE "sqlitening.inc"
'Requires Windows 10 Pro

FUNCTION PBMAIN () AS LONG 'NetSend.bas

 LOCAL sUsers,sFile,sData,sMsg AS STRING

 sFile  = "test123.dat"             'must be in FACT or error -9
 sData  = "some data"               'second parameter of slPut

 sUsers = "127.0.0.1"               'receivers of shell(msg.exe)
 slPutFile sFile,sData,"E0"         'slPut using SQLitening
 sMsg   =  sFile + $CR + slGetError 'message for receivers

 NetSendMessage sUsers,sMsg,0       '0=don't timeout on receiver screens

END FUNCTION

SUB NetSendMessage(sComputers AS STRING,BYVAL sMsg AS STRING, SecondsOnScreen AS LONG)
 LOCAL sShell AS STRING
 IF INSTR("-/",LEFT$(TRIM$(sMsg),1)) THEN
  sMsg = WRAP$(sMsg,"[","]") 'TRIM of sMsg started  "-" or "/" or is empty
 END IF

 'Messages are independent of programs
 'They are placed in a queue and only 1 is displayed on receiving computer
 'If Time: (SecondsOnScreen=0) received must click to clear the message off the screen
 'Sending message to all sessions using the "*" may be needed so it automatically insert
 'If first character of message is "/" or "-"  or "" the message wouldn't send, now wrapped within $DQ

 LOCAL x,pid AS LONG
 FOR x = 1 TO PARSECOUNT(sComputers) 'ComputerName, IPAddress, ...
  'put into a string for your testing
  sShell = "msg.exe /server:"+ TRIM$(PARSE$(sComputers,x)) + " * /time:" + FORMAT$(SecondsOnScreen) + " " + sMsg
  'MSGBOX sShell
  pid = SHELL(sShell,0)
 NEXT
END SUB
#IF 0
SEND a message TO a user.

MSG {username | sessionname | sessionid | @filename | *}
    [/SERVER:servername] [/TIME:seconds] [/V] [/W] [message]

  username            Identifies the specified username.
  sessionname         The NAME OF the session.
  sessionid           The ID OF the session.
  @filename           Identifies a file containing a list OF usernames,
                      sessionnames, AND sessionids TO SEND the message to.
  *                   SEND message TO ALL sessions ON specified server.
  /SERVER:servername  SERVER TO contact (DEFAULT IS current).
  /TIME:seconds       Time delay TO wait FOR receiver TO acknowledge msg.
  /V                  DISPLAY information about actions being performed.
  /W                  Wait FOR response FROM USER, useful WITH /V.
  message             Message TO send.  IF NONE specified, prompts FOR it
                      OR reads FROM stdin.
#ENDIF
4
Quote from: undefinedThanks,
I'll dig into this and see if I understand it.
/Fim W.
Welcome.
Hope this is easier to follow.
Happy New Year!

MACRO bt(parm) = slBuildBindDat(TRIM$(parm),"T")

'select bind text
searchfor="HEIDI"
slSelBind "Select c1,c2 From t1 Where c1 = ? Order by c2", slBuildBindDat(TRIM$(searchfor),"T")
slSelBind "Select c1,c2 From t1 Where c1 = ? Order by c2", bt(searchfor)

'insert bind text
sColumn1 = "Heidi"
sColumn2 = "Klum"
slexeBind "Insert into t1 values(?,?)", bt(sColumn1) + bt(sColumn2)

'==========================================================================================
'Example with optimized GetRecordSet function

#INCLUDE "sqlitening.inc"
MACRO bt(parm) = slBuildBindDat(TRIM$(parm),"T")

FUNCTION PBMAIN () AS LONG
LOCAL sColumn1,sColumn2,searchfor,sEverything,rs() AS STRING, x AS LONG

slOpen    "junk.db3","C"
slexe    "Drop Table If Exists T1"
slexe    "Create Table If Not Exists T1(C1 text collate nocase,C2 text collate nocase)"

'insert bind text
sColumn1 = "Heidi"
sColumn2 = "Klum"
slexe "begin immediate"
FOR x = 1 TO 10
  slexeBind "Insert into t1 values(?,?)",bt(sColumn1) + bt(sColumn2)
NEXT
slexe "end"

'select bind text
searchfor = "hEidi"
slSelBind "Select c1,c2 From t1 Where c1 = ? Order by c2", bt(searchfor)

Display data using returned function and by traversing the rs() array
sEverything = "Returned string value" + $CR +  GetRecordSet(rs(), $TAB) + $CR + $CR
sEverything+="Loop through rs() array" + $CR

FOR x = LBOUND(rs) TO UBOUND(rs)
  sEverything+= USING$("#  &&",x,rs(x),$CR)
NEXT
? sEverything,,"Optimized GetRecordSet"
END FUNCTION

'==========================================================================================
FUNCTION GetRecordSet (sRecordSet() AS STRING,sColumnDelimiter AS STRING) AS STRING
LOCAL colnum,rownum,columns,highelement AS LONG
columns = slGetColumnCount                          'number of columns to return
DIM sCol(1 TO columns) AS STRING                    'avoid concatenation of current row
highelement = 10000                                'arbitrary top limit of recordset array

REDIM sRecordset(0 TO highelement) AS STRING        'column names will be in element 0
FOR colnum=1 TO columns                            'for
  sCol(colnum) = slGetColumnName(colnum)            ' get column name for the column
NEXT                                                ' next
sRecordset(0) = JOIN$(sCol(),sColumnDelimiter)      'concatenate into sRecordset(0)

DO WHILE slGetRow                                  'read recordset loop
  INCR rownum                                        'actual number of reads rows
  IF rownum > highelement THEN                      'redim recordset array if needed
   highelement = highelement + 10000
   REDIM PRESERVE sRecordset(0 TO highelement)
  END IF
  FOR colnum = 1 TO columns                          'read columns of current row
   sCol(colnum) = slf(colnum)                        'place into current column array
  NEXT
  sRecordset(rownum) = JOIN$(sCol(),sColumnDelimiter)'concatenate columns into current recordset(row)
LOOP
IF rownum = 0 THEN
  ERASE sRecordSet
  EXIT FUNCTION                                      'exit if no rows returned
END IF
REDIM PRESERVE sRecordset(0 TO rownum)              'shrink array to actual size
FUNCTION = JOIN$(sRecordSet(),$CR)                  'optionally return as string
END FUNCTION
5
Very interesting read:
https://proprivacy.com/vpn/comparison/nigeria-vpn

I have been successfully using SQLitening over a VPN between machines that share the exact same dedicated VPN server using the same user name and password.  This might be the best way to go if this is allowed.
I paid nothing extra and didn't need any dedicated IP address (other then share same exact server.)

I will finally have time to work on encrypting SQLitening on 12/3.
6
https://help.logmein.com/pkb_Home?q=share%20a%20port&l=en_US&c=products%3Almihamachi2&atype=FAQ__kav

It looks like you share a folder and use Windows mapping.
I only connected 2 machines and used chat.
I didn't use SQLite with it.
There are links to PDF files at the bottom of their home page.
Many use it so there must be better docs on the net, don't know where.
7
Windows 10 has a built-in VPN server, but I couldn't connect.
Some on the internet say there is a problem introduced in a Windows update.
https://pureinfotech.com/setup-vpn-server-windows-10/

I got Hamachi to connect, but didn't go any further.

I'll go back to encrypting the TCP data being transmit to the server.
8
Paid NordVPN connected with a couple machines using same username/password on one of their servers marked as allowing dedicated connections.  Might break terms of service or not work with more machines.
9
I will look into it later today.
NordVPN worked great.
I don't like the price of the dedicated server.
I will also add AES256 to SQLitening TCP within a few days.


10
I will do the same.
11
NordVPN has a feature called Internet Kill switch.
The SQLitening server can't be accessed while it is on.

12
Another way to go would be to install a VPN server.  I would still encrypt the TCP sends and receives.
It is amazing that I can't find much information on people doing this.  Looking in the wrong places.

https://www.howtogeek.com/135996/how-to-create-a-vpn-server-on-your-windows-computer-without-installing-any-software/

I would definitely check this inexpensive route with Hamachi that installs as a service.
Free up to 5 users, $49 a year for 32 users.
https://vpn.net/

https://www.vpnmentor.com/reviews/logmein-hamachi/


Other VPN's to compare to:
https://vpnpro.com/vpn-solutions/logmein-hamachi-review/

https://beebom.com/hamachi-alternatives/
13
From NordVPN:

If you were to purchase this very week, we can offer the following pricing:

Advanced NordVPN Teams package for 75 USD/ user along with a Dedicated gateway/ server for 336 USD for a year.





This at least shows one way to go.
I always thought that routers could be setup or flashed to connect securely to each other?
14
From NordVPN:

Business packages start from 5 annual accounts.

Regarding connectivity, yes, you can connect from anywhere in the world to a particular country of our shared servers. You can also purchase a Dedicated server to have one static IP that is not shared between anyone but your team, which you can assign particular users to it and use it per your preferences.

We also have a Back Friday deal going on this very week, if you make a purchase until the end of it.

We could add AES256 to SQLitening's TCP routines.
15
I am using a VPN service and can connect to the SQLitening server only if using the same dedicated VPN server.

I don't know if a person using the same VPN service could connect to the server from another account or if they need my username and password?
I have sent an email to the VPN service.