Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #################### LOGIN_windows username password halEnv d3Username d3Password ####################
- 81 # Author: Frank_n_Beans
- 82 # Precondition: N/A
- 83 # Takes: 5 strings
- 84 # Where: username == windows username and password == windows
- 85 # password. halEnv (waphaldev, waphaltest...)
- 86 # d3Username == d3 password d3Password == d3 password
- 87 # Returns: TRUE if login is successful or FALSE if not
- 88 # Notes: Would rather set an error var but need to research
- 89 #################### LOGIN_connect username password d3Username d3Password ####################
- 90 proc LOGIN_connect { username password halEnv d3Username d3Password} {
- 91
- 92 set TRUE 1
- 93 set FALSE 0
- 94 set rcode $TRUE
- 95
- 96 spawn telnet $halEnv
- 97
- 98 expect -re ".*login:.*"
- 99
- 100 exp_send -- "$username\r"
- 101
- 102 expect -re ".*Password:.*"
- 103
- 104 exp_send -- "$password\r"
- 105
- 106 #expect {
- 107 # -re ".*Login incorrect.*" {
- 108 # set rcode $FALSE
- 109 # return $rcode
- 110 # }
- 111 #
- 112 # }
- 113
- 114 expect -re ".*Connected.*"
- 115
- 116 exp_send -- "\r"
- 117
- 118 expect -re ".*Enter your user id:.*"
- 119
- 120 exp_send -- "$d3Username\r"
- 121
- 122 # expect {
- 123 # -re ".Invalid user or password.*" {
- 124 # set rcode $FALSE
- 125 # return $rcode
- 126 # }
- 127 # }
- 128
- 129 expect -re ".*user password:.*"
- 130
- 131 exp_send -- "$d3Password\r"
- 132
- 133 # expect {
- 134 # -re ".Invalid user or password.*" {
- 135 # set rcode $FALSE
- 136 # return $rcode
- 137 # }
- 138 # }
- 139
- 140 expect -re ".*Select Function or OFF.*:"
- 141
- 142 return $rcode
- 143 }
- 109,2-9 Bot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement