Skip to content

Commit

Permalink
Merge branch 'master' of
Browse files Browse the repository at this point in the history
  • Loading branch information
PlashSpeed-Aiman committed Feb 22, 2023
2 parents f7deb24 + 9e3846f commit 92934c3
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/indexxx.json
/PassGo.exe
/PassGo.exe~
/Financial.pdf
/Finance.pdf
/timetable.pdf
/cs.html
gopher.png
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ module PassGo

go 1.19

require golang.org/x/term v0.0.0-20220919170432-7a66f970e087
require (
github.com/sqweek/dialog v0.0.0-20220809060634-e981b270ebbf
golang.org/x/term v0.0.0-20220919170432-7a66f970e087
)

require (
github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf // indirect
github.com/sqweek/dialog v0.0.0-20220809060634-e981b270ebbf // indirect
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
)
5 changes: 2 additions & 3 deletions imaalum/imaalum.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ func GetGeneralExamTimeTable(ws *sync.WaitGroup, client *ImaalumClient) {
}
_ = os.WriteFile("timetable.pdf", bodyBytes, 0644)

dialog.XPlatMessageBox("Done", "course_timetable Downloaded")
ws.Done()
dialog.XPlatMessageBox("Done", "Exam Timetable Downloaded")

}

Expand Down Expand Up @@ -119,7 +118,7 @@ func GetConfimationSlip(ws *sync.WaitGroup, client *ImaalumClient) {

_ = os.WriteFile("cs.html", bodyBytes, 0644)

dialog.XPlatMessageBox("Done", "Download Complete")
dialog.XPlatMessageBox("Done", "Confirmation Slip download complete")
}

client.client.Get("https://cas.iium.edu.my:8448/cas/logout?service=http://imaluum.iium.edu.my/")
Expand Down
1 change: 1 addition & 0 deletions libs/imaalum.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package libs
77 changes: 77 additions & 0 deletions libs/wifi.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package libs

import (
"PassGo/dialog"
userstruct "PassGo/model/user"
"crypto/tls"
"encoding/base64"
"encoding/json"
"fmt"
"io/fs"
"log"
"net/http"
"net/url"
"os"
)

func store_pass(username string, password string) {
userVal := username
passwordVal := password
encodeUser := base64.StdEncoding.EncodeToString([]byte(userVal))
encodePass := base64.StdEncoding.EncodeToString([]byte(passwordVal))
data := userstruct.User{
User: encodeUser,
Password: encodePass,
}
// fmt.Println(data)
file, _ := json.MarshalIndent(data, "", " ")
err2 := os.WriteFile("indexxx.json", file, fs.ModePerm)
if err2 != nil {
log.Fatal(err2)
}
}
func logout_network() {
transCfg := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // ignore expired SSL certificates
}
client := &http.Client{Transport: transCfg}
_, err := client.Get("https://captiveportalmahallahgombak.iium.edu.my/auth/logout.html")
if err != nil {
dialog.XPlatMessageBox("ERROR", "UNABLE TO LOGOUT (I GUESS)")
}
dialog.XPlatMessageBox("SUCCESS", "YOU ARE LOGGED OUT OF IIUM-STUDENT")

}
func connect_network() {
file, err := os.ReadFile("indexxx.json")
if err != nil {
log.Fatal(err)
}
var UserStruct userstruct.User
json.Unmarshal(file, &UserStruct)
decodeUser, _ := base64.StdEncoding.DecodeString(UserStruct.User)
decodePass, _ := base64.StdEncoding.DecodeString(UserStruct.Password)
formVal := url.Values{
"user": {string(decodeUser)},
"password": {string(decodePass)},
"url": {"http://www.iium.edu.my/"},
"cmd": {"authenticate"},
"Login": {"Log In"},
}
transCfg := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // ignore expired SSL certificates
}
client := &http.Client{Transport: transCfg}
resp, err := client.PostForm("https://captiveportalmahallahgombak.iium.edu.my/cgi-bin/login", formVal)

if err != nil {
dialog.XPlatMessageBox("ERROR", err.Error())
log.Fatal(err)
}
var res map[string]interface{}

json.NewDecoder(resp.Body).Decode(&res)
dialog.XPlatMessageBox("SUCCESS", "You are now connected to IIUM-Student")
fmt.Println(res)

}
Binary file added main.dll
Binary file not shown.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,7 @@ func connect_network() {

}

<<<<<<< HEAD
// MessageBox of Win32 API.
=======
>>>>>>> 9e3846fd639fc98ebf62c38d0215ee126184cc39

0 comments on commit 92934c3

Please sign in to comment.