token-validator: ssh_access is given through receiveChallenge
This commit is contained in:
parent
847e941b0c
commit
268695563c
@ -351,13 +351,13 @@ func accessibleChallenge(r *http.Request, ps httprouter.Params, _ []byte) (inter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// receiveChallenge treats TP1{shadow} and TP2, TP3 challenges.
|
// receiveChallenge treats TP1{shadow,ssh_access} and TP2, TP3 challenges.
|
||||||
func receiveChallenge(r *http.Request, ps httprouter.Params, body []byte) (interface{}, error) {
|
func receiveChallenge(r *http.Request, ps httprouter.Params, body []byte) (interface{}, error) {
|
||||||
if chid, err := strconv.Atoi(string(ps.ByName("chid"))); err != nil {
|
if chid, err := strconv.Atoi(string(ps.ByName("chid"))); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if chid < 0 {
|
} else if chid < 0 {
|
||||||
return nil, errors.New("This challenge doesn't exist")
|
return nil, errors.New("This challenge doesn't exist")
|
||||||
} else if chid != 0 && chid <= len(challenges) {
|
} else if chid != 0 && chid < len(challenges) {
|
||||||
return nil, errors.New("This is not the good way to hit this challenge")
|
return nil, errors.New("This is not the good way to hit this challenge")
|
||||||
} else {
|
} else {
|
||||||
var gt givenToken
|
var gt givenToken
|
||||||
|
@ -24,7 +24,8 @@ const tuto_progress = [
|
|||||||
8: { title: "Bonus disk", icon: "💽", label: "Bonus 2"},
|
8: { title: "Bonus disk", icon: "💽", label: "Bonus 2"},
|
||||||
9: { title: "Bonus email", icon: "📧", label: "Bonus 3"},
|
9: { title: "Bonus email", icon: "📧", label: "Bonus 3"},
|
||||||
10: { title: "Wg tunnel", icon: "🚇", label: "Tunnel up"},
|
10: { title: "Wg tunnel", icon: "🚇", label: "Tunnel up"},
|
||||||
11: { title: "Uploaded SSH key", icon: "💊", label: "SSH"},
|
11: { title: "SSH key", icon: "🔑", label: "Key"},
|
||||||
|
12: { title: "SSH evade", icon: "💊", label: "SSH"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
100: { title: "HTTP on IP", icon: "0", label: "HTTP IP"},
|
100: { title: "HTTP on IP", icon: "0", label: "HTTP IP"},
|
||||||
|
Reference in New Issue
Block a user